home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
qwez42.zip
/
WIND_REZ.DOC
< prev
Wrap
Text File
|
1991-04-01
|
170KB
|
4,686 lines
WINDOWS R-E-Z
VER. 4.20
CONNECT Software
6192 Fawn Meadow
Farmington, NY 14425
Richard Magnanti
(716) 924-3439
CPS: 71020,2040
GENIE: R.MAGNANTI
DELPHI: MAGNANTI
COPYRIGHT (c) 1988 - 1991 BY:
CONNECT Software
ALL RIGHTS RESERVED
CONTENTS
Differences in versions of WINDOWS R-E-Z ----------------- 1
Important notes for BASIC 7.0/7.1 ( PDS ) users.-------- 2-3
General overview ( list of procedures included ) ------- 4-6
System and programming requirements ---------------------- 6
Windowing routines ------------------------------------ 7-15
The Active Window ------------------------------- 7
1.00 SETWIND --------------------------------------- 7-9
SETWIND examples -------------------------------- 9
1.01 MAKEWIND ------------------------------------ 10-11
1.02 CHNGWIND ------------------------------------ 11-12
1.03 PRINTW ----------------------------------------- 12
1.04 SAVEWIND ------------------------------------ 12-13
1.05 RESAVE ----------------------------------------- 13
1.06 RSTRWIND --------------------------------------- 14
1.07 DELWIND ---------------------------------------- 14
1.08 CLRWIND ---------------------------------------- 14
1.09 NEWCOLOR ------------------------------------ 14-15
1.10 LINEW ------------------------------------------ 15
1.11 WINDSTATUS ------------------------------------- 16
Pulldown windows ------------------------------------- 17-21
2.00 SETPULL ------------------------------------- 17-19
SETPULL example -------------------------------- 19
2.01 PULLDOWN --------------------------------------- 20
2.02 CHNGPULL ------------------------------------ 20-21
Scroll windows --------------------------------------- 22-30
3.00 SCRLWIND ------------------------------------ 22-25
SCRLWIND example ( Auto-exit ) -------------- 25-26
SCRLWIND example ( Multiple scroll windows )- 26-29
3.01 MARKED% ------------------------------------- 29-30
Get answer routine ----------------------------------- 31-32
4.00 GETANS -------------------------------------- 31-32
Input routines --------------------------------------- 33-42
5.00 INPTWIND ------------------------------------ 33-35
5.01 SETINPT ------------------------------------- 35-38
SETINPT example ----------------------------- 38-39
5.02 MULTINPT ------------------------------------ 39-42
Editing features for input routines ------------ 43
Directory routines ----------------------------------- 44-47
6.00 GETDISK ---------------------------------------- 44
Copyright (c) 1988 - 1991 By: CONNECT Software All Rights reserved.
6.01 FINDPATH --------------------------------------- 44
6.02 SETDISK ------------------------------------- 44-45
6.03 DISKSIZE --------------------------------------- 45
6.04 FINDDIR ------------------------------------- 45-47
A directory scroll window ( example ) ------- 48-49
Keyboard and Mouse routines -------------------------- 50-51
7.00 KEYMOUSE% -------------------------------------- 50
KEYMOUSE% example --------------------------- 50-51
7.01 MBUTTONS --------------------------------------- 51
7.02 MOUSEON ---------------------------------------- 51
Sound Routine ------------------------------------------- 51
8.00 DOSOUND ---------------------------------------- 51
Program format --------------------------------------- 52-55
Making a customized library ----------------------------- 56
Description of files --------------------------------- 57-58
Errors ----------------------------------------------- 59-63
Appendix --------------------------------------------- 64-67
Color attribute chart -------------------------------- 64
Multi-field code chart ------------------------------- 65
Border designation chart ----------------------------- 66
Keymouse code values --------------------------------- 67
Restrictions and disclaimer ----------------------------- 68
Copyright (c) 1988 - 1991 By: CONNECT Software All Rights reserved.
***************************
* NOTE ------ READ THIS! *
***************************
The information in this documentation refers to the
enhanced version of WINDOWS R-E-Z. Differences between the
QuickBasic ( 4.00, 4.00b and 4.50 ) and the BASIC 7.+ (PDS)
versions are detailed. The documentation can be used for the
unenhanced versions with the following exceptions.
1. MULTI-FIELD INPUT SCREENS - A maximum of 2 input
screens with a maximum of 25 fields per screen are available
in the unenhanced version. This compares to 10 multi-field
screens with up to 100 fields each, in the enhanced version.
2. MEMORY - The code in the unenhanced libraries is not
modular. Therefore executable programs made with the unen-
hanced libraries will contain all of the code even though
all of the procedures are not used. This will substantially
increase the length of any executable file and program.
With the enhanced versions of WINDOWS R-E-Z, it is not
necessary to link modules to executable programs if routines
in a module are not used by the program. Much smaller ex-
ecutable programs are consequently possible.
An additional library is included in the enhanced
versions which does not contain error checking or window
status capability. This library can be used after the
program is de-bugged and also represents an opportunity for
considerable memory reduction.
3. The BASIC 7.0/7.1 unenhanced version does not allow
the use of unnamed ( blank ) COMMON blocks. The enhanced
version has provisions for the use of same.
4. The section labeled "MAKING A CUSTOMIZED LIBRARY"
refers to the enhanced version of WINDOWS R-E-Z.
**********************************************************
** For information on obtaining the enhanced version **
** of WINDOWS R-E-Z see the file ORDER.ME. **
**********************************************************
1
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
Important notes for BASIC 7.0/7.1 ( PDS ) users.
ENHANCED AND UNENHANCED VERSIONS:
The /Ea option may be used when loading QBX. This allows
the use of expanded memory.
Window memory resides in a separate segment of string space
reserved for strings placed in unnamed ( blank ) COMMON
blocks. DO NOT USE BLANK COMMON BLOCKS IN YOUR PROGRAM.
EXAMPLE: COMMON SHARED A$ ' NOT PERMITTED
COMMON SHARED /BLOCKNAME/ A$ ' PERMITTED
Maximum window memory is 64k bytes. Calls to MAKEWIND or
SAVEWIND requesting window memory in excess of 64k bytes
will result in an "Out of string space" error message. As
64k represents sixteen full display windows (80 column mode)
this limitation should not be restrictive.
The use of far strings is required. This is the default for
programs compiled from the QBX environment. If the source
code is compiled on the command line the /Fs option must be
used with BC.
ENHANCED VERSION ONLY:
An additional object file PDSMEM70/71.OBJ is included which
allows the use of unnamed (blank) COMMON blocks. It must re-
place the object file PDSMEM.OBJ which is included in the
libraries. Window memory will share main module string
space after this change is made. To make this change;
1. Make new library files. ( Save old library files! )
LIB PDSALL70.LIB-PDSMEM.OBJ+PDSMEM70.OBJ; ( BASIC 7.0 )
LIB PDSNER70.LIB-PDSMEM.OBJ+PDSMEM70.OBJ; ( BASIC 7.0 )
LIB PDSALL71.LIB-PDSMEM.OBJ+PDSMEM71.OBJ; ( BASIC 7.1 )
LIB PDSNER71.LIB-PDSMEM.OBJ+PDSMEM71.OBJ; ( BASIC 7.1 )
2. Make new quick-libraries. ( Save old quick-libraries! )
LINK/Q PDSALL70.LIB,PDSALL70.QLB,,QBXQLB.LIB; ( BASIC 7.0 )
LINK/Q PDSNER70.LIB,PDSNER70.QLB,,QBXQLB.LIB; ( BASIC 7.0 )
LINK/Q PDSALL71.LIB,PDSALL71.QLB,,QBXQLB.LIB; ( BASIC 7.1 )
LINK/Q PDSNER71.LIB,PDSNER71.QLB,,QBXQLB.LIB; ( BASIC 7.1 )
2
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
UNENHANCED VERSION ONLY:
The library in the unenhanced, BASIC 7.0/7.1, version of
WINDOWS R-E-Z was made using BASIC 7.1. If you are using
BASIC 7.0 the following message will appear when making
executable programs from within the QBX environment.
LINK WARNING L4051: BRT71EFR.LIB: CANNOT FIND LIBRARY
Enter new file spec:
Press ENTER. The file, BRT71EFR.LIB, is not required.
The enhanced version of WINDOWS R-E-Z supplies libraries for
the user specified version of BASIC ( version 7.0 or 7.1 ).
3
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
*** GENERAL OVERVIEW ***
WINDOWS R-E-Z is a collection of QuickBASIC and assembly
routines which provide users of QuickBASIC ver. 4.00+ and
BASIC 7.0+ ( PDS ) with a complete window management system.
With WINDOWS R-E-Z users can make, save, restore, and delete
up to twenty windows. The memory used to save windowed
areas is dynamically allocated and outside of basic's normal
data storage area leaving more room for the basic programs
data. Windows are assigned a number from zero to twenty.
"INPUT WINDOWS" and "MULTI-FIELD INPUT" routines are
also provided. "INPUT WINDOWS" provide a convenient means
to prompt for, and receive an input. "MULTI-FIELD INPUT"
allows users to define up to 10 input screens, each having up
to 100 input fields. Numerous options are included for
input fields.
WINDOWS R-E-Z provides users the ability to incorporate
"PULLDOWN WINDOWS", emulating those used in the QuickBASIC
programming environment, in their programs.
Directory routines find the default drive and path, disk
size and free space, and directory listing for any path.
File size, date, time, and attributes can also be found.
Several other routines are included which allow the use
of "GET ANSWER WINDOWS" and "SCROLL WINDOWS". The ability
to read KEYBOARD and MOUSE input is also provided with
WINDOWS R-E-Z.
All of the routines require a minimal amount of initial-
ization and the resulting programs present a professional
appearance.
Unlike many other basic "add-ons", WINDOWS R-E-Z
provides extensive error detection and reporting.
Procedures included:
SETWIND -------- Set up routine for windowing procedures.
MAKEWIND ------- Makes a window. Saves windowed area to
window memory. The window becomes the
"active window".
SAVEWIND ------- Saves a screen area to window memory.
RESAVE --------- Saves the active window.
4
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
RSTRWIND ------- Restores a window area to the display.
DELWIND -------- Deletes a window area from window memory.
CHNGWIND ------- Changes the active window to another
window.
NEWCOLOR ------- Changes the print-to color of the active
window for text printed by PRINTW.
The print-to color is used by CLRWIND to
clear the active window's interior.
CLRWIND -------- Clears the interior of the active window.
PRINTW --------- Prints text in the active window using
the window's "print-to" color.
LINEW ---------- Prints a line in the active window using
the window's "print-to" color.
SCRLWIND ------- Places a scrollable list in the active
window.
MARKED% -------- (FUNCTION) Returns position of marked
items after a call to SCRLWIND.
WINDSTATUS ----- Reports window memory status.
SETPULL -------- Set up routine for pulldown windows.
PULLDOWN ------- Makes pulldown windows.
CHNGPULL ------- Changes the color of, and disables or
enables an item in a pulldown window.
INPTWIND ------- Makes an input field with an optional
window. The field can be edited by
the user.
SETINPT -------- Set up routine for multi-field input
screens.
MULTINPT ------- Places input fields on the screen as
defined by a previous call to SETINPT.
GETANS --------- Makes a get answer window or single line
prompt. Waits for a single key response.
DOSOUND -------- Produces sound determined by SETWIND.
5
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
GETDISK -------- Returns the default disk drive.
SETDISK -------- Sets the default disk drive.
FINDPATH ------- Returns the default path for any drive
( current directory ).
DISKSIZE ------- Returns disk size and free space.
FINDDIR -------- Returns the directory of any drive or path
in a string array.
KEYMOUSE% ------ (FUNCTION) Waits for keyboard or mouse
input, or mouse movement. Returns a code
for the key pressed or mouse movement.
MBUTTONS ------- Redefines the mouse buttons.
MOUSEON -------- Turns the mouse on, off, or disables
movement detection.
--------------------------------------------------------
*** SYSTEM AND PROGRAMMING REQUIREMENTS ***
COMPUTER:
IBM PC (XT or AT) or compatible computer. One disk drive.
VIDEO ADAPTER CARD:
MONO, CGA, EGA or VGA emulating CGA.
PROGRAMMING LANGUAGE:
For the QB4.+ version;
QuickBASIC version 4.00 or greater.
- Text mode
For the BASIC 7.+ (PDS) version;
BASIC 7.0 or greater.
- Text mode
- Requires use of "far strings". This is the default
if executable programs are produced from within
QBX. If modules are compiled using BC on the command
line ( outside of the QBX environment ) the /Fs option
must be used.
DOS: Version 2.1 or higher.
-------------------------------------------------------
6
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
USING WINDOWS R-E-Z
THE ACTIVE WINDOW
When a window is defined ( made ) the number assiged to it
by the programmer represents the area covered by the window.
The area is restored or deleted via it's "number". Up to 20
window areas can be saved. The memory used to save the
window areas is automatically managed by WINDOWS R-E-Z.
Any time a window is made it becomes the "active" window. The
active window is used by the following routines.
PRINTW --- Prints text in the active window.
LINEW ---- Prints a line in the active window.
SCRLWIND - Places a scrollable list in the active
window.
CLRWIND -- Clears all text from the interior of the
active window.
RESAVE -- Saves the active window and any text in the
active window.
NEWCOLOR - Changes the "print-to" color of the active
window.
1.00 SETWIND (FST%,SND%,SHAD%,NOHI%,ISDOT%,ISARROW%,DFORMAT%)
Description: SETWIND must be called at least once in
any program using the routines in WINDOWS-R-E-Z, prior
to calling the routines. This procedure initializes
window memory. It also sets the default windowing
speed, sound, and window shadow color. In addition it
determines how the pulldown window and scroll window
routines display high intensity characters and the
direction arrow. SETWIND also determines the date
format used by input routines INPTWIND and MULTINPT.
The first call to SETWIND initializes window memory and
sets the default parameters. Subsequent calls to
SETWIND will not affect window memory but can be used
to change the default parameters.
Arguments: FST% is used to allow "fast" windowing
if a CGA video card, or emulation, is detected. IF
FST% = 0 window routines will be slower on computers
with CGA. If FST% = 1 the window routines will be
"fast" on computers with CGA. This may, however, cause
"snow" with certain CGA cards. If a monochrome card is
detected, FST% is ignored. All windowing is "fast".
7
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
SND% determines which sound will be
generated by the routines. If SND% = 1 a "CLICK" sound
will be generated. If SND% = 2 will a "BEEP" sound will
be produced. Any other value produces no sound.
SHAD% sets the color for window shad-
ows. See the color attribute chart for details. Set-
ting SHAD% to 7 works well for monochrome display while
setting SHAD% to 8 works well for color displays.
NOHI% determines how pulldown and
scroll window routines display high intensity "key"
characters. If NOHI% = 0 and the key character's color
is set to a high intensity it is displayed as high
intensity. If NOHI% = 1 high intensity "key" characters
are displayed in reverse video. This is appropriate for
LCD displays which can not display high intensity
characters. NOHI% affects "key" characters only. SEE
PULLDOWN AND SCRLWIND DESCRIPTIONS.
ISDOT% sets a period or comma for
the decimal designator. If ISDOT% = 1 the decimal
designator is a period. If ISDOT% <> 1 the decimal
designator is a comma. This is appropriate for some
users outside of the USA.
ISARROW% tells the pulldown and scroll
window routines to display or not display the direction
arrow on the right side of the windows. If ISARROW% = 1
the arrow will be displayed. If ISARROW% = 0 the arrow
will not be displayed.
DFORMAT% determines the valid date
format for input routines INPTWIND and MULTINPT.
DFORMAT% defaults to 1 if set outside of it's allowable
range. The date fromat is affected by the specified
width of the input field in MULTINPT and INPTWIND.
Listed are the permissible values for DFORMAT% and the
resulting allowable date formats.
DFORMAT% DATE FORMAT DATE FORMAT
(FIELD WIDTH = 10) (FIELD WIDTH = 8)
1 MM-DD-YYYY MM-DD-YY
2 MM/DD/YYYY MM/DD/YY
3 DD-MM-YYYY DD-MM-YY
4 DD/MM/YYYY DD/MM/YY
5 DD.MM.YYYY DD.MM.YY
8
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
NOTE: If a CLEAR statement is executed by the program
all window memory is lost. Any window areas saved in
window memory are lost. SETWIND must be called again
to re-initialize window memory after executing a CLEAR
statement.
------------------------------------------------------------
Examples of a call to SETWIND. Use the first example if
SETWIND will be called only once in the program. Use the
second example if SETWIND may be called several times in the
program. In example two the call to SETWIND is placed in a
sub-routine. This is more memory efficient than calling
SETWIND several times in the program.
------------------------------------------------------------
Example one: This is the easier method but the ability to
change parameters based on the user's requirements is
inhibited.
This call sets windowing and print speed to fast, sound to
click, window shadow color to 7, no hi-intensity to no,
decimal deignator to a period, and scroll bar direction arrow
to on. The date format is set to mm-dd-yyyy.
CALL SETWIND(1, 1, 7, 0, 1, 1, 1)
------------------------------------------------------------
Example two: This method provides the ability to easily
change the parameters. In this example the sound starts out
as a "click" but is changed to a "beep" by the program
FAST% = 1: SND% = 1: SHAD% = 7
NOHI% = 0: ISDOT% = 1: ISARROW% = 1: DFORMAT%=1
GOSUB SETITUP ' Initial call to SETWIND
'program
'Now turn the sound to "beep".
SND% = 2
GOSUB SETITUP ' 2nd call to SETWIND
'program
CALL DOSOUND
END
SETITUP:
CALL SETWIND(FAST%,SND%,SHAD%,NOHI%,ISDOT%,ISARROW%,DFORMAT%)
RETURN
-------------------------------------------------------------
9
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
1.01 MAKEWIND (W%, LABEL$, TR%, LC%, WIDE%, NR%, ATTR%, BORBER%)
Description: Makes a window. May also save a window-
ed area to window memory. The window becomes the active
window. Calls to PRINTW, LINEW, SCRLWIND, CLRWIND,
RESAVE, and NEWCOLOR refer to the active window.
Arguments: W% is the window number and must equal 0 to
20. If W% = 0 the area under the window is not saved.
A window is simply made. If W% is from 1 to 20 the area
under the window is saved and may be restored at a later
time via a call to RSTRWIND. If W% is the number of a
window area previously saved by MAKEWIND or SAVEWIND an
error is reported.
LABEL$ is the text printed on the top
border or in the title box (see BORDER%) of the window.
By default the print starts on the second column. If
the left character of LABEL$ ="@" the text will be
centered. If LABEL$ is too long it will be truncated to
fit on the top border or in the title box.
TR% is the top row of the window. If TR% =
100 the window will be centered from top to bottom. TR%
can range from 1 to 23 or may equal 100. Any other
value for TR% will result in a error.
LC% is the left column position of the win-
dow. If LC% = 100 the window will be centered from left
to right. LC% can range from 1 to 78 if the display
width is 80 or from 1 to 38 if the display width is 40.
WIDE% is the window's width. WIDE% must be
greater than 2. WIDE% + LC% -1 must not be greater than
the displays width ( 40 or 80 ).
NR% is the number of rows in the window and
must be greater than 2. NR% + TR% must not be greater
than 26. If NR% is less than 5 a window title box is
not permitted.
ATTR% is the window's color and may be in
the range of 0 to 255. The foreground ( window's label
and border ) color equals ATTR% MOD 16. The background
color equals INT( ATTR% / 16 ). If the background color
is greater than 7 the foreground flashes and the back-
ground color equals background color - 8. If the fore-
ground and background colors are the same the border and
10
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
label will not be visible. ( SEE THE COLOR ATTRIBUTE
CHART.) ATTR% becomes the print-to color for window W%.
BORDER% sets the window's border and shadow
and can be up to 3 digits in length.
DIGIT = #3 #2 #1
Example = 1 1 1 ( 111 )
Digit #1 sets the border.
0 = No border
1 = Single line border
2 = Double line border
Digit #2 sets the shadow.
0 = No shadow
1 = Right/Bottom shadow
2 = Left/Bottom shadow
3 = Left/Top shadow
4 = Right/top Shadow
Digit #3 set the title box.
0 = No title box
1 = title box
The example (111) has a 1 for each digit. The window
will has a single lined border, a shadow on the right
and bottom and a title box
NOTE: If BORDER% is 100 or greater and the number of
rows (NR%) is less than 5 title boxes are not permitted.
( SEE THE BORDER DESIGNATION CHART IN THE APPENDIX FOR
FURTHER DETAILS.)
1.02 CHNGWIND (W%)
Description: Makes window (W%) the active window.
W% must represent a window area in window memory.
Argument: W% is the window number. It must range from
0 to 20. If W% does not represent a window saved by a
11
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
previous call to MAKEWIND, CHNGWIND reports an error.
NOTE: W% CAN NOT REPRESENT A WINDOW SAVED BY "SAVEWIND".
IT MUST REPRESENT A WINDOW SAVED BY "MAKEWIND".
1.03 PRINTW (TEXT$, R%, LC%)
Description: Prints text to the active window. Care
must be used to assure the active window is visible
as PRINTW will print predicated on the coordinates of
the active window regardless of it's visibility. It is
advisable, therefore, to print to a window immediately
after it is made the active window. The text's color
will be the print-to color of the active window. If
no window is active when PRINTW is called an error will
be reported.
Arguments: TEXT$ is the text to be printed.
R% is the row in the window were the text
will print . If R%=1 the text will print in the first
row below the border or title box. PRINTW may be used to
print a label in the bottom border of the window by
setting R% to the number or rows in the active window
minus 1 ( minus 3 if a title box was specified ). An
invalid value for R% will result in a reported error.
LC% is the left column where TEXT$ starts
printing. If LC%=100 the text will be centered left to
right. IF LC% plus the length of TEXT$ is greater than
the windows width minus 2 an error will be reported.
1.04 SAVEWIND (W%, TR%, LC%, WIDE%, NR%)
Description: Saves a portion of the screen in window
memory. This procedure is the same as MAKEWIND except
no window is made. The area designated by the arguments
is saved. If the number assigned to W% represents a
window area previously saved by MAKEWIND or SAVEWIND an
error is reported. An area saved via SAVEWIND can be
"popped" to the screen at appropriate times during
program execution by RSTRWIND ( see description ). A
screen area saved by SAVEWIND DOES NOT BECOME THE
ACTIVE WINDOW. SAVEWIND differs from RESAVE in that it
saves an area of the screen specified by it's
arguments. RESAVE saves the area of the screen as
designated by the coordinates of the active window.
12
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
Arguments: W% must range from 1 to 20.
See MAKEWIND for a description of the
remaining arguments.
1.05 RESAVE
Description: Saves the active window, it's interior,
and shadow. As window number 0 can not be saved the
active window can not be window number 0. If there is
no active window or window number 0 is active when
RESAVE is called an error will be reported.
The screen area saved under the active window is removed
from window memory and replaced with the active window
and it's interior. After complex screens are made in
the active window's interior, RSAVE can be used to save
them. They can be restored to the screen using
RSTRWIND. Use RESAVE immediately after a window is made
and it's interior is filled as RESAVE will save the
area of the screen determined by the active window's
coordinates, even if it is not visible.
Use RESAVE as follows;
1. Make a window number 1 to 20 via a call to MAKEWIND.
This becomes the active window.
2. Print in the window using PRINTW. Additional windows
may also be printed in the window. Use window number
0 to make the additional windows, as the screen area
under them need not be saved.
3. Call CHNGWIND to make the window number used in step
1 the active window. ( Only required if additional
windows were made inside the original window. )
4. Call RESAVE to save active window.
5. Use RSTRWIND to "pop" the window and it's interior on
the screen any time during program execution.
6. After the window is restored to the screen it may be
printed in again provided it is the active window.
This may require a call to CHNGWIND.
Arguments: None.
13
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
1.06 RSTRWIND (W%, DELFLAG%)
Description: Restores a window area previously saved
by MAKEWIND, SAVEWIND or RESAVE. The window area (W%)
must exist in window memory or RSTRWIND does nothing.
Arguments: W% is the number ( 1 to 20 ) assigned to
the saved window area to be restored to the screen. The
window area is returned to it's original coordinates.
DELFLAG% is set to zero to keep the
windowed area in window memory. If the DELFLAG% is not
zero the saved window area (W%) is deleted from window
memory. If W% was the active window an active window
will no longer exist.
1.07 DELWIND (W%)
Description: Deletes a saved window area (W%) from
window memory, if it exists in window memory. If the
window is the active window an active window will no
longer exist.
Argument: W% is the window area number.
1.08 CLRWIND
Description: Clears the interior of the active window.
Care must be taken to assure that active window is
visible as CLRWIND clears the area of the screen
designated as the interior of the active window regard-
less of the window's visibility. The window will be
cleared with it's print-to color. If no window is
active when CLRWIND is called, an error is reported.
Arguments: None
1.09 NEWCOLOR ( ATTR% )
Description: Changes the print-to color of the active
window. Text printed in the window by PRINTW or lines
printed in the window by LINEW will assume the new color
specified by this routine. If the active window is
14
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
cleared via a call to CLRWIND, it's interior will be
cleared with the color specified by NEWCOLOR. The color
designation will be retained and used by subsequent
calls to PRINTW or LINEW for the window which was active
when NEWCOLOR was called. If no window is active when
NEWCOLOR is called, an error is reported.
Argument: ATTR% is the new color attribute. SEE
THE COLOR ATTRIBUTE CHART.
1.10 LINEW ( ROW%, TYP% )
Description: Prints, or erases a line in the active
window. If an active window does not exist an error is
reported. The line will assume the print-to color of the
active window. As the border characters are changed
when a line is printed, the color of the border
characters may change also. This will occur if the
print-to color is not the same as the color of the
border characters in the active window.
Arguments: ROW% is the row, of the interior, of the
active window where a line will print. If ROW% < 1 or
ROW% greater then the number of rows in the interior of
the active window an error will be reported.
TYP% is the type of line which will print
and may be as follows;
TYP% Line type
1 Single line
2 Double line
0 Erases a line and returns
normal border characters.
Other values Defaults to single line.
NOTE: IF TYP% = 0 ANY TEXT ON THE LINE IN THE WINDOW,
POSITIONED IN ROW, ROW% WILL BE ERASED.
15
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
1.11 WINDSTATUS
Description: This is a programming tool. Calling
WINDSTATUS reports each window's number, top row, left
column, width, number of rows, and attribute (color).
The attribute refers to the original attribute specified
by the call to MAKEWIND for each window. If the
attribute is "SAVED" the window area was saved by a call
to SAVEWIND, not MAKEWIND. WINDSTATUS also reports the
active window and total window memory used to save
window areas. Window number zero does not use window
memory as the area under it is not saved. To use
WINDSTATUS place a call to WINDSTATUS in the program at
the location where it is desireable to view each windows
parameters. The program will terminate and must be
restarted. First remove the call to WINDSTATUS.
Arguments: None.
16
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
***** PULLDOWN WINDOWS *****
These procedures generate a maximum of 10 pulldown windows
with a maximum of 20 items ( lines ) in each window. The
area covered by the pulldown windows is saved and restored
as the window moves from one menubar item to the next.
Unlike the other windowing procedures pulldown windows will
only work in the 80 column display width mode. To select a
menubar item the ARROW keys can be used or the first letter
of the menubar item may be pressed. To select an item from
any of the pulldown windows the ARROW keys, or "KEY CHAR-
ACTER" for the item may be pressed. If the ARROW keys are
used the ENTER or RETURN key must be pressed to finalize the
selection. If a letter is pressed, and it is found, the
procedure is automatically exited without the need to press
the ENTER or RETURN keys. The ESC key always exits.
2.00 SETPULL (TR%, LC% , WD%, BAR$, PWIND$())
Description: Must be called to set up the routine
PULLDOWN. Call SETPULL only once at the beginning of
each program using pulldown windows.
Arguments: TR% is the top row position of the menubar.
It must range from 1 to 21. If the top row position of
the menubar is set too low not allowing a pulldown window
to fit on the display an error will be reported ( WINDOW
WON'T FIT or SHADOW WON'T FIT ) when the pulldown window
is accessed.
LC% is the left column position of the
menubar. It must range from 1 to 73. If the left column
position of the menubar is set too high not allowing a
pulldown window to fit on the display an error will be
reported ( WINDOW WON'T FIT or SHADOW WON'T FIT ) when
the pulldown window is accessed.
WD% is the width of the menubar. WD% is
self adjusting if it is set outside of the permissible
range. The maximum width of the menubar is 81 - LC%.
The minimum width of the menubar equals the width of the
individuals items in the menubar plus two spaces between
each item plus two preceding spaces and one trailing
space. If WD% is set too low it self adjusts to the
minimum width. If it is set too high it self adjusts to
the maximum width. WD% only changes the length, by
adding trailing spaces to the menubar, if it is greater
then the minimum width and less then or equal to the
maximum width of the menubar.
17
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
BAR$ is the menubar. If BAR$ = "THIS IS A
SAMPLE" the menubar is; THIS IS A SAMPLE. Two spaces
are placed between each menubar item ( THIS, IS, A,
SAMPLE ). Two spaces are added two the front of the
menubar and one space is added to the end of the menubar.
The maximum length of the menubar is 80 characters
including the spaces. No more than 10 menubar items are
permitted. Error detection checks for the menubar length
and number of items.
PWIND$() is an array containing all of
the strings representing the items in each pulldown
window. PWIND$() must be in the correct format. ( SEE:
EXAMPLE OF A CALL TO SETPULL ). The last item in each
pulldown window must be followed by a "***" in PWIND$().
"ENDPULL" in PWIND$() marks the end of all pulldown
windows. PWIND$(1) must be the first string in the
array, NOT PWIND$(0).
Each selectable item in PWIND$() has a "KEY CHARACTER".
The key character is the character which is searched for
when a key is pressed while in the PULLDOWN enviornment.
The key character defaults to the first character in
each item. To designate the key character as a
different character follow the character with a "@".
EXAMPLE:
PWIND$(1) = "Get File" ( Key character = "G")
PWIND$(2) = "Save F@ile" ( Key character = "F")
The "@" will not be displayed when the string is printed
in the pulldown window. The description for KEYATTR%
for the routine PULLDOWN describes how to make the key
character a different color, or high intensity, enabling
users to distinguish it as the key character.
NOTE: DO NOT PLACE THE "@" IN POSITION ONE OR TWO OF THE
STRING AS IT WILL PRINT IN THE PULLDOWN WINDOW. AS
STATED THE KEY CHARACTER WILL DEFAULT TO POSITION ONE IF
THE "@" IS OMITTED FROM THE STRING. THIS ELIMINATES THE
NEED TO PLACE THE "@" IN POSITION TWO.
If an element of PWIND$() = "-" and it is not the first
or last item in a pulldown window it will segment the
pulldown window by placing a line across the width of it.
If the "-" is the first or last item in the pulldown
window it will print as a "-".
18
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
EXAMPLE: PWIND$(3) = "-" Providing PWIND$(3) is not
last item in the pulldown window PWIND$(3) will
print as a line across the window.
--------------------------------------------------------
EXAMPLE OF A CALL TO SETPULL
BAR$ = "THIS IS A SAMPLE" 'MENUBAR STRING DEFINED.
N%=20 'USE THIS METHOD SO
DIM PWIND$(N%) 'PWIND$() IS DYNAMIC.
'DON'T USE DIM PWIND$(20)
TEMP%=0
WHILE PWIND$(TEMP%) <> "ENDPULL"
TEMP% = TEMP% + 1 'TEMP% MUST START WITH 1.
READ PWIND$(TEMP%) 'READ PULLDOWN WINDOW
WEND 'DATA.
TR%=1: LC%=1: WD%=80
CALL SETPULL (TR%, LC%, WD% BAR$, PWIND$()) 'SET PULLDOWN
ERASE PWIND$ 'COMPLETELY ERASES PWIND$()
'IF IT IS DYNAMIC.
DATA HELLO, JOE,*** :' WINDOW #1
DATA HOW, ARE, -, YOU,*** :' WINDOW #2 LINE IN ROW 3
DATA I,AM@,FINE,*** :'#3 - "M" = KEY CHARACTER FOR "AM"
DATA BYE,*** :'#4 - ONE ITEM.
DATA ENDPULL :'END OF DATA ( CASE SENSITIVE )
--------------------------------------------------------
First the menubar is defined, then an array is dimen-
sioned to hold the pulldown window's data. This is only
a temporary array to hold the data and is erased after
SETPULL is called. The data is then read. The "***"
signals the end of each pulldown window and MUST be
entered exactly as shown. The "ENDPULL" signals the end
for all pulldown windows and MUST be the last data item
read. If the format is not exactly as shown an error
will be reported or the windows will not be as expected.
In the example shown the first menubar item is "THIS".
It's associated pulldown window contains the two items
"HELLO" and "JOE". The last menubar item is "SAMPLE"
and it's pulldown window contains one item "BYE". The
menubar is located on line 1, column 1 ( TR%=1 and
LC% = 1 ). It occupies the entire row as WD% = 80.
NOTE: THE DATA MUST BE IN THE FORMAT SHOWN. THE CHAR-
ACTERS "***" MARK THE END OF EACH INDIVIDUAL WINDOW AND
THE WORD "ENDPULL" MARKS THE END OF ALL PULLDOWN WINDOWS.
19
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
2.01 PULLDOWN (MENUBAR%, WINDITEM%, ATTR%, KEYATTR%, BORDER%)
Description: Places the menubar on line one. Places
the user in the pulldown window environment.
Arguments: MENUBAR% is the sequential number ( left
to right ) of selected menubar item . It is returned to
the calling procedure (PULLDOWN). If the second item in
the menubar is selected, MENUBAR% will equal two. If the
ESC key is pressed MENUBAR% = 0.
WINDITEM% represents the row number of the
selected pulldown window item. It is returned to the
calling procedure. If the ESC key is pressed WINDITEM%
= 0.
NOTE: A LINE IN A PULLDOWN WINDOW OCCUPIES A ROW
POSITION.
ATTR% is the color. It follows the same
rules as described in MAKEWIND except a flashing
foreground is not permitted. Any value over 127 is
changed to ATTR% MOD 128.
KEYATTR% is the color of the key character
for each item in the pulldown windows. If KEYATTR% = 0
the key character will be the same color as the other
characters in each window item. This would be
appropriate if the first character in each item is
ALWAYS the key character. Setting KEYATTR% to a
different color, or high intensity, allows users to
distinguish the character as the key character for each
item in the list. Any value for KEYATTR% over 127 is
changed to KEYATTR% MOD 128.
BORDER% is the pulldown window's border
designation. BORDER% can be 0,1,2,10,11 or 12 for
pulldown windows. Any other value for BORDER% will
result in an error. SEE THE BORDER DESIGNATION CHART.
2.02 CHNGPULL ( BARITEM%, WINDITEM%, ATTR% )
Description: Changes the color of an item in a pulldown
window. Also disables or enables the ability to select
the item.
20
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
Arguments: BARITEM% is the sequential number ( left
to right ) of the menubar selection associated with the
item's pulldown window.
WINDITEM% is the row position of the item
in the pulldown window's interior.
NOTE: A LINE IN A PULLDOWN WINDOW OCCUPIES A ROW
POSITION.
ATTR% serves two purposes.
If ATTR% > 0 it changes the color of the item
specified by BARITEM% and WINDITEM% to ATTR% ( SEE THE
COLOR ATTRIBUTE CHART ). The key character in the item
also assumes the color specified by ATTR%. The ability
to select the item from the pulldown window is disabled.
Any value for ATTR% over 127 is changed to ATTR% MOD
128.
If ATTR% = 0 the color of the item, and it's key char-
acter is returned to it's original status as defined in
the original call to PULLDOWN. The ability to select
the item is enabled.
NOTE: Call CHNGPULL after the call to SETPULL for the
pulldown windows. Calls to CHNGPULL prior to the call
for SETPULL will have no effect on the pulldown windows.
21
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
***** SCROLL WINDOWS *****
SCRLWIND places a scrollable list in the active window.
A highlight ( scroll ) bar is placed over a specified item in
the list and can be moved by the user via the UP and DOWN
ARROW keys. Pressing the ENTER key returns the sequential
item number covered by the scroll bar. The HOME, END, PG UP,
and PG DN keys move the scroll bar as indicated. SCRLWIND
searches from the position of the scroll bar to the last item
in the window ( list ) to see if the key pressed is the KEY
CHARACTER of any element of the list. If a match is found the
scroll bar moves to that position in the list.
3.00 SCRLWIND (LIST$(), ENTRIES%, KIND$, RTRN%, KEYATTR%)
Description: Places a list ( LIST$() ) in the active
window. The list is ENTRIES% long.
Arguments: LIST$() is the array holding the strings to
be placed in the scroll window. Each element of the
array is a line in the scroll window. If the length of
any element is greater then the width of the window - 4
an error is reported. LIST$(1) must be the first string
in the array, NOT LIST$(0).
Each selectable item in LIST$() has a "KEY CHARACTER".
The key character is the character which is searched for
when a key is pressed while in the SCRLWIND enviornment.
The key character defaults to the first character in
each item. To designate the key character as a
different character follow the character with a "@" in
the string.
EXAMPLE: LIST$(1) = "Get File" ( Key character = "G")
LIST$(2) = "Save F@ile"( Key character = "F")
The "@" will not be displayed when the string is printed
in the scroll window. The description for KEYATTR% for
this routine describes how to make the key character a
different color, or high intensity, enabling users to
distinguish it as the key character.
NOTE: DO NOT PLACE THE "@" IN POSITION ONE OR TWO OF THE
STRING AS IT WILL PRINT IN THE SCROLL WINDOW. AS STATED
THE KEY CHARACTER WILL DEFAULT TO POSITION ONE IF THE
"@" IS OMITTED FROM THE STRING. THIS ELIMINATES THE
NEED TO PLACE THE "@" IN POSITION TWO.
22
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
If an element of LIST$() = "-" and it is not the first
item in the list or the last item in the list and all of
the items in LIST$() will fit in the window's interior
the scroll window will be segmented. A line will print
across the window as determined by the position of the
"-" in LIST$(). If the previous conditions are not met
the string will print as a "-".
EXAMPLE: LIST$(2) = "-" ( Provided LIST$(2) is not
the last item in the list and the number of
interior rows in the window is greater than
two, LIST$(2) will print as a line.)
ENTRIES% is the number of elements in the
array ( LIST$() ) to use in the scroll window .
KIND$ is as follows;
IF KIND$ = "A" when entering SCRLWIND the scroll window
is an "AUTO-EXIT" scroll window. If the key pressed
equals the key character of an item in the scroll window
and the item is between the scroll bar and the end of the
list the routine will automatically exit. The position
of the selected item in LIST$() will be returned in
RTRN%. If RTRN% = 2, LIST$(2) was selected.
IF KIND$ ="M" when entering SCRLWIND the scroll window is
a "MARK" scroll window. Pressing the <+> or INSERT key
marks the item covered by the scroll bar. A right arrow
is printed to the left of the item in the scroll window
to signify it has been marked. Pressing the <-> or
DELETE key un-marks an item if it was marked. Striking
the PRINT key or space bar marks all items, unless they
were all previously marked, in which case the PRINT key
or space bar will unmark all items. Pressing the ENTER
or RETURN key returns a coded string in KIND$ which
represents the marked items. If KIND$ ="" no items were
marked. If any items were marked KIND$ will be ENTRIES%
long. Each character in KIND$ will correspond to an
element in LIST$(). If the first character of KIND$=" ",
LIST$(1) was not marked. If the second character, in
KIND$ = CHR$(26), LIST$(2) was marked. Each un-marked
element of LIST$() will have a corresponding space (" ")
in KIND$ while each marked element will have a
corresponding right arrow ( CHR$(26) ) in KIND$. See the
description for the function MARKED% for a method of
decoding KIND$.
IF KIND$ = "S" when entering SCRLWIND the scroll window
is a "SINGLE MARK" scroll window. Provided there is more
23
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
than one item ( ENTRIES% > 1 ) in the scroll window, one
item will be marked as in the preceding example for a
"MARK" scroll window. Only one item can be marked,
however. The marked item follows the scroll bar.
Pressing TAB, ENTER, RETURN or ECS will exit the scroll
window. If TAB, ENTER or RETURN is pressed the selected
item number is returned in RTRN%. If the scroll bar is
over LIST$(2), RTRN% = 2. If ESC is pressed RTRN% = 0.
SINGLE MARK scroll windows with one entry ( ENTRIES%=1 )
do not mark the item. RTRN% = 1 if ENTER or RETURN is
pressed. RTRN% = 0 if ESC is pressed and RTRN% = -1 if
TAB is pressed. These scroll windows can be used as
<OK>, <CANCEL>, <ABORT> etc... scroll windows.
NOTE: SEE THE SECTION LABELED "Multiple Scroll Windows"
TO SEE HOW SINGLE MARK SCROLL WINDOWS CAN BE USED TO
DISPLAY AND USE SEVERAL SCROLL WINDOWS AT ONE TIME.
IF KIND$ = "V" the scroll window is "VIEW ONLY". The
window will be filled with the strings in LIST$() and the
routine will be exited.
IF KIND$ = "SV" the scroll window is "VIEW ONLY - SINGLE
MARK" scroll window. The window will be filled with the
strings in LIST$(). If ENTRIES% > 1 the item designated
by the value of RTRN% will be marked. ( See description
for RTRN%. )
Any other value for KIND$ when entering SCRLWIND results
in a "REGULAR" scroll window. After the scroll bar
is moved to the selected item, pressing the ENTER or
RETURN key returns the selected item in RTRN%.
RTRN% serves two purposes. One is to place
the scroll bar over a the item specified by RTRN% when
entering SCRLWIND. If RTRN% < 1 or RTRN% > ENTRIES%,
RTRN% defaults to 1 and the scroll bar will be positioned
over the first item in the window.
EXAMPLE: RTRN% = 2 ( If there are a minimum of two
items in the scroll window ( ENTRIES% > 1 ) the scroll
bar will be over LIST$(2) when entering SCRLWIND. )
RTRN% also returns the selected item when exiting
SCRLWIND. If RTRN% = 2, LIST$(2) was selected. IF ECS
is pressed to exit SCRLWIND, RTRN% = 0. If TAB is
pressed and the scroll window is a "SINGLE MARK" scroll
window with over one entry, RTRN% returns the selected
item. If the scroll window is a "SINGLE MARK" scroll
window with one entry and TAB is pressed, RTRN% = -1.
24
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
NOTE: THE ITEM SELECTED IN LIST$() ( AS INDICTED BY THE
VALUE OF RTRN% ) MAY CONTAIN A "@" TO INDICATE THE KEY
CHARACTER. IF IT IS NESESSARY TO PRINT THE ITEM THE "@"
CAN BE REMOVED FROM IT USING THE FOLLOWING FUNCTION.
' FUNCTIONS MUST BE DECLARED. RTRN% = ITEM # SELECTED
' FROM LIST$().
DECLARE FUNCTION NO$( ITEM$ )
'( Place this at the start of the module.)
' IF RTRN% = 2 AND LIST$(RTRN%) = "Save F@ile", LIST$(2)
' CAN BE PRINTED AS "Save File" as follows.
PRINT NO$( LIST$(RTRN%) )
' INCLUDE THIS FUNCTION IN YOUR PROGRAM
FUNCTION NO$ ( ITEM$ )
A% = INSTR ( ITEM$, "@" )
IF A% < 3 THEN '"@" SHOULD NOT BE IN POSITION
NO$ = ITEM$ ' 1 OR 2, OR NO "@" IN ITEM$.
ELSE
NO$ = LEFT$(ITEM$, A% - 1) + MID$(ITEM$, A% + 1)
END IF
END FUNCTION
KEYATTR% is the color of the key character
for each item in the scroll window. If KEYATTR% = 0
the key character will be the same color as the other
characters for each window item. This would be
appropriate if the first charcter in each item is ALWAYS
the key character. Setting KEYATTR% to a different
color, or high intensity, allows users to distinguish the
character as the the key character for each item in the
list. KEYATTR% has no effect on the background color of
an item when it is covered by the scroll bar. It can
effect the background color for the key character. This
is useful for computers without high intensity or color
capabilities.
-------------------------------------------------------
'EXAMPLE OF A CALL TO SCRLWIND - AUTO EXIT SCROLL WINDOW
DIM LIST$(11)
FOR X% = 1 TO 11 'ALWAYS START WITH 1
READ LIST$(X%)
NEXT
25
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
CALL MAKEWIND(15, "", 1, 1, 10, 13, 112, 2)
KIND$ = "A" : RTRN% = 3: KEYATTR% = 116
CALL SCRLWIND(LIST$(), 11, KIND$, RTRN%, KEYATTR%)
DATA ONE
DATA TW@O
' FOR ABOVE KEY CHAR. = "W"
DATA TH@REE
' FOR ABOVE KEY CHAR. = "H"
DATA FOUR
DATA FIV@E
' FOR ABOVE KEY CHAR. = "V"
DATA "-"
' FOR ABOVE PUT A LINE IN ROW 6
DATA SIX@
' FOR ABOVE KEY CHAR. = "X"
DATA SEVEN
DATA EIGHT
DATA NINE
DATA TEN
-------------------------------------------------------
The scroll window is the window defined by the call to
MAKEWIND as it is the active window when SCRLWIND is
called. The list in the scroll window is the items in
the data statements, as they were read into LIST$().
The second parameter in the call to SCRLWIND is the
number of items in the list ( 11 ). As KIND$ ="A"
before calling SCRLWIND, the scroll window is an "AUTO-
EXIT SCROLL" window. Since RTRN% = 3 when entering
SCRLWIND the scroll bar will start over the third item (
THREE ). The sixth DATA item = "-". Therefore, a line
will print in row six of the scroll window. The key
character for each item will be red ( KEYATTR% = 116 ).
RTRN% will equal the selected item when SCRLWIND is
exited. As reading the data takes time, quicker scroll
windows will be generated if all arrays used in scroll
windows are filled using READ and DATA statement during
program initialization.
-------------------------------------------------------
' EXAMPLE - MULTIPLE SCROLL WINDOWS ( SINGLE MARK )
' FIRST INITIALIZE THE DATA FOR THE SCROLL WINDOWS. DO
' THIS AT THE BEGINNING OF THE PROGRAM FOR SPEED.
DIM SWIND%(5), STR%(5), SLC%(5), SWID%(5), SNR%(5)
DIM SENTRIES%(5), STITLE$(5)
DIM SRTRN1$(4), SRTRN2$(5), SRTRN3$(4)
DIM SRTRN4$(1), SRTRN5$(1)
26
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
FOR X% = 1 TO 5 ' DATA FOR 5 SCROLL WINDOWS
READ SWIND%(X%) ' WINDOW # FOR EACH SCROLL WINDOW
READ STR%(X%) ' TOP ROW
READ SLC%(X%) ' LEFT COLUMN
READ SWID%(X%) ' WIDTH
READ SNR%(X%) ' NUMBER OF ROWS
READ SENTRIES%(X%) ' ENTRIES
READ STITLE$(X%) ' TITLE ( FOR WINDOWS TITLE BOX )
FOR Y% = 1 TO SENTRIES%(X%)
SELECT CASE X% ' X% = WINDOW #
CASE 1
READ SRTRN1$(Y%) ' LIST FOR SCROLL WINDOW 1.
CASE 2
READ SRTRN2$(Y%) ' LIST FOR SCROLL WINDOW 2.
CASE 3
READ SRTRN3$(Y%) ' LIST FOR SCROLL WINDOW 3.
CASE 4
READ SRTRN4$(Y%) ' LIST FOR SCROLL WINDOW 4.
CASE 5
READ SRTRN5$(Y%) ' LIST FOR SCROLL WINDOW 5.
END SELECT
NEXT
NEXT
' DATA FOR EACH SCROLL WINDOW
' WINDOW#, TOP ROW,LEFT COLUMN,WIDTH,ROWS,ENTRIES,TITLE,
' ITEMS IN THE LIST
DATA 16,5,16,12,8,4," TYPE",COLONIAL,SPLIT,BI-LEVEL,RANCH
DATA 17,5,35,12,9,5," COLOR",WHITE,BLUE,TAN,BROWN,YELLOW
DATA 18,5,54,12,8,4," LOCATION",NORTH,SOUTH,EAST,WEST
DATA 19,14,24,14,3,1,"","----OK----"
DATA 20,14,43,14,3,1,"","--CANCEL--"
' MARK THE FIRST ITEM IN EACH SCROLL WINDOW. CAN BE
' USED FOR ANY ITEM IN THE WINDOW.
SRTRN1% = 1: SRTRN2% = 1: SRTRN3% =1
' ******* LATER IN THE PROGRAM DO THIS:
' USE THE PREVIOUS DATA FOR THE MULTIPLE SCROLL
' WINDOWS.
' SAVE THE VALUES FOR THE MARKED ITEM IN EACH SCROLL
' WINDOW. NEEDED FOR ESC OR --CANCEL-- .
PRTRN1% = SRTRN1%: PRTRN2% = SRTRN2%: PRTRN3% = SRTRN3%
27
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
' MAKE FIVE WINDOWS. WINDOW NUMBERS 16 - 20 ( SWIND%() ).
' AS BORDER% MOD 100 = 0 THERE IS NO BORDER -- BE
' CAREFULL AS THE BLANK BORDER STILL OCCUPIES A POSITION
' ON THE SCREEN.
' AS THE BORDER (BRDR%) ARGUMENT =100 FOR WINDOWS 16, 17
' AND 18 THOSE WINDOWS HAVE A TITLE BOX. THE "OK" AND
' AND "CANCEL" SCROLL WINDOWS HAVE LESS THAN 5 ROWS SO
' THEY CAN'T HAVE NO TITLE BOX, THUS BRDR% IS SET TO 0.
' SINCE THE ARGUMENT FOR COLOR = 112 THE BACKGROUND
' COLOR WILL BE WHITE WITH A BLACK FOREGROUND.
' **** SUGGESTION: WHILE DEVELOPING MULTIPLE SCROLL
' WINDOWS SET THE BORDER TO PRINT. THIS WILL GIVE A
' BETTER PICTURE AS TO HOW BIG THE WINDOWS ARE. AFTER
' DEVELOPMENT THE BORDER CAN BE SET BLANK ( 100 OR 0 ).
FOR X% = 1 TO 5
' BORDER IS TITLE BOX EXCEPT WINDOW 19 & 20
IF SWIND%(X%) > 18 THEN BRDR%=0 ELSE BRDR%=100
'PUT THE FOLLOWING CALL TO MAKEWIND ON ONE LINE.
CALL MAKEWIND (SWIND%(X%), STITLE$(X%), STR%(X%),
SLC%(X%), SWID%(X%), SNR%(X%), 112, BRDR%)
NEXT
KIND$ = "SV" ' THIS MAKES THE SCROLL WINDOWS "SINGLE
' MARK - VIEW" SCROLL WINDOWS FOR THE
' FIRST PASS THROUGH THEM. THE ITEMS IN
' THE LIST FOR EACH SCROLL WINDOW WILL
' PRINT IN THE WINDOW AND SCRLWIND WILL BE
' EXITED. AFTER ALL FIVE WINDOWS ARE
' FILLED KIND$ IS SET TO "S" AND THE FIRST
' SCROLL WINDOW BECOMES ACTIVE. A USER
' ACTION IS THEN REQUIRED.
' FILL THE SCROLL WINDOWS FIRST, THEN GO BACK TO THE
' FIRST ONE ( WINDOW # 16 ). LAST ARGUMENT = 0 SO THE
' KEY CHARACTER IS THE SAME COLOR ( BLACK ON WHITE ) AS ALL
' OTHER CHARACTERS. THE KEY CHARACTER IN THIS EXAMPLE IS
' ALWAYS THE FIRST CHARACTER.
STARTS:
' SCROLL WINDOW TITLED "TYPE"
CALL CHNGWIND (16) ' MAKE 16 THE ACTIVE WINDOW
CALL SCRLWIND (SRTRN1$(), SENTRIES%(1), KIND$, SRTRN1%, 0)
IF SRTRN1% = 0 GOTO NOCHANGE ' ESC
28
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
' SCROLL WINDOW TITLED "COLOR"
CALL CHNGWIND (17)
CALL SCRLWIND (SRTRN2$(), SENTRIES%(2), KIND$, SRTRN2%, 0)
IF SRTRN2% = 0 GOTO NOCHANGE ' ESC
' SCROLL WINDOW TITLED "LOCATION"
CALL CHNGWIND (18)
CALL SCRLWIND (SRTRN3$(), SENTRIES%(3), KIND$, SRTRN3%, 0)
IF SRTRN3% = 0 GOTO NOCHANGE ' ESC
' "OK" SCROLL WINDOW. SINGLE ENTRY SO NO ITEMS ARE MARKED.
CALL CHNGWIND (19)
CALL SCRLWIND (SRTRN4$(), SENTRIES%(4), KIND$, TEMP%, 0)
IF TEMP% = 0 GOTO NOCHANGE ' ESC
IF KIND$ = "S" THEN ' WAS NOT "SV" ( VIEW )
IF TEMP% = 1 GOTO PROCEED ' WAS ENTER OR RETURN
IF TEMP% = 0 GOTO NOCHANGE ' WAS ESC
END IF
' "CANCEL" SCROLL WINDOW. SINGLE ENTRY SO NO ITEMS ARE MARKED.
CALL CHNGWIND (20)
CALL SCRLWIND (SRTRN5$(), SENTRIES%(5), KIND$, TEMP%, 0)
IF KIND$ = "SV" THEN ' DONE DISPLAYING WINDOWS SO
KIND$ = "S" ' MAKE "SINGLE MARK" SCROLL
GOTO STARTS ' WINDOWS AND START OVER.
END IF
IF TEMP% = - 1 GOTO STARTS ' FOR SINGLE ENTRY SCROLL
' WINDOWS TEMP% = -1 FOR TAB.
' PROGRAM PROCEEDS HERE IF TAB WAS NOT PRESSED FOR
' "CANCEL" SCROLL WINDOW. ENTER, RETURN OR ESC MUST HAVE
' BEEN PRESSED. PROGRAM GOES TO NOCHANGE TO RESTORE VALUES
NOCHANGE:
' ESC OR CANCEL SELECTED. RESTORE PREVIOUSLY SAVED VALUES.
SRTRN1% = PRTRN1%: SRTRN2% = PRTRN2%: SRTRN3% = PRTRN3%
PROCEED:
' IF ENTER OR RETURN WAS PRESSED WITH THE "OK" SCROLL
' WINDOW ACTIVE SRTRN1%, SRTRN2%, AND SRTRN3% NOW HOLD THE
' MARKED ITEMS FOR THEIR RESPECTIVE SCROLL WINDOWS. IF ESC
' OR "CANCEL" WAS SELECTED THE PROGRAM GOES TO NOCHANGE AND
' SRTRN1%, SRTRN2%, AND SRTRN3% ARE LOADED WITH THEIR OLD
' VALUES.
3.01 MARKED%(RTRN$, START%)
Description: MARKED%(RTRN$, START%) is a function used
to decode RTRN$ after a call to SCRLWIND is made with
29
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
the MARK option ON. MARKED%(RTRN$, START%) will equal
the next position in RTRN$ starting from position START%
which contains a CHR$(26). If the third element (item)
in LIST$() was marked in the call to SCRLWIND and START%
=1, THEN: MARKED%(RTRN$,START%) = 3.
Arguments: RTRN$ is the string returned by calling
SCRLWIND with the MARKED option ON. RTRN$ = "" if no
items were marked.
START% is the postion in RTRN$ to start
searching for a CHR$(26). A CHR$(26) in RTRN$
represents a marked element in the string array LIST$()
used in SCRLWIND. Every time a position in RTRN$ is
found which corresponds to a marked element of LIST$(),
START% is set to a new value which is equal to the
"marked" position in RTRN$ + 1. This is the next
position in RTRN$ where the search will start for
another "marked" position. If MARKED% =0 there are no
more "marked" positions in RTRN$ or RTRN$ = "".
-------------------------------------------------------
'EXAMPLE USING THE FUNCTION MARKED% (RTRN$,START%) THIS
'EXAMPLE PRINTS THE MARKED ITEMS IN LIST$() AFTER A CALL
'TO SCRWIND.
'GIVEN: SCRLWIND HAS BEEN CALLED. THE FOURTH AND TENTH
'ELEMENTS OF LIST$() WERE MARKED. RTRN$ WAS RETURNED BY
'A PREVIOUS THE CALL TO SCRLWIND.
DECLARE FUNCTION MARKED%(RTRN$,START%) ' MUST BE IN
'(Put this at the start of the module) ' MODULE USING
' FUNC. MARKED%.
START%=1 ' START THE SEARCH AT POSITION 1
' OF RTRN$.
DO ' MARKED% = 0 AFTER
A% = MARKED%(RTRN$, START%) ' ALL MARKED ITEMS
IF A% = 0 THEN EXIT DO ' ARE FOUND OR IF
PRINT LIST$(A%)
END IF
LOOP
-------------------------------------------------------
The first time through the loop, MARKED% (RTRN$, START%)
will equal 4, and LIST$(4) will print. START% is auto-
matically set to 5, the next position to start searching
RTRN$ for a "marked" position in RTRN$. The second loop
will set MARKED% (RTRN$,START%) to 10 and LIST$(10) will
print. As there are no more marked positions, MARKED% =
0 and the loop be exited.
30
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
***** GET ANSWER WINDOWS *****
This routine pauses the program, prompts the user, and waits
for the user to press a key. The prompt may, optionally, be
windowed. The key may be any key, or an individual key from a
list of permissible keys. The area covered by prompt and
window, if one exists, is restored after the key is pressed.
4.00 GETANS (PROMPT$, CHOICE$, ANS$, TR%, LC%, ATTR%, BORDER%)
Description: Generates a prompt with an optional window
and pauses, waiting for a single key reply.
Arguments: PROMPT$ is the prompt (i.e. Press any key )
or question (i.e. Are you sure? Y/N ). It may be
optionally windowed ( SEE BORDER% ). The width of the
window is determined by the length of PROMPT$. If
PROMPT$ is too long making the window, or prompt, too
wide to fit on the screen an error will be reported.
CHOICE$ is the valid keys the user can
press to exit GETANS. If CHOICE$ = "" any key will
exit. This would be appropriate if PROMPT$ = "Press any
key". If CHOICE$ = "YN" then the "Y", "y", "N" or
"n" keys will exit GETANS. The ESC key will always exit
regardless of CHOICE$.
ANS$ is the key pressed. It is returned in
upper case. If CHOICE$ = "" then ANS$ = "". If ESC is
pressed CHR$(27) is always returned in ANS$.
TR% is the top row. See MAKEWIND
LC% is the left column. See MAKEWIND
ATTR% is the color designation. See
MAKEWIND. Although it is permissible to set ATTR% > 127
to make the border flash the text will not flash.
BORDER% is the window's border designation.
Title boxes ( BORDER% > 42 ) are not permitted. Set
BORDER% to 0 for no window ( prompt only ). SEE THE
BORDER DESIGNATION CHART.
EXAMPLE OF A CALL TO GETANS:
CALL GETANS ("Are you sure? Y/N", "YN", ANS$, 100, 100,
240, 11)
( Above must be on one line. )
31
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
A window will be generated with the text "Are you sure?
Y/N" printed in it. With TR% and LC% set to 100 the
window will be centered on the screen ( See MAKEWIND ).
ATTR% = 240, therefore, the window will be white with
black text and a black flashing border. The user may
press the N, n, Y, y, or ESC keys to exit. The key
pressed will be returned to GETANS in the argument ANS$.
32
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
***** INPUT ROUTINES *****
Input routines provide users with the ability to generate a
single input field ( INPTWIND ), or multiple input fields
( MULTINPT ). Full editing is provided within each field.
Up to 10 multiple input screens may be used, with each screen
capable of supporting up to 100 fields. Fields may be defined
as numeric, alpha/numeric, or date. Numeric fields may be
designated 0 to 6 decimal places and optionally padded with
leading zero's. Numerous additional options are available.
5.00 INPTWIND (P$,CODE$,TR%,LC%,WD%,ATTR%,RES$,RTRN$,RKEY%,BRDR%)
Description: Makes an input field, which may optionally
be windowed. The area under the field or window is auto-
matically saved. It is restored upon exiting the routine.
Arguments: P$ is the message ( prompt ) which will be
printed to the left of the input field or in the title
box of the window, if one is specified. If P$ is
preceded by a "@" it will be centered in the title box.
CODE$ sets the type of input field and may
may equal the following.
"A" - Alpha/numeric. All standard keys are
active.
"U" - Alpha/numeric. Upper case.
"L" - Alpha/numeric. Lower case.
"D" - Date. If a field is a date field it can
not be exited unless the date is valid or
the field is blank. The number keys are
active. Depending on the date format
specified in the call to SETWIND, the
".", "/" or "-" key will be active also.
Valid dates range from 01/01/1901 to
12/31/2099 if the width of the date field
is 10, or 01/01/01 to 12/31/99 if the
width of the date field is 8. SEE DES-
SCRIPTION FOR DFORMAT% IN ROUTINE
"SETWIND".
"P0" or "0" - Numeric. The value of the string desig-
"P1" or "1" nates the number of decimal places that
"P2" or "2" will be returned, even if more are
"P3" or "3" entered. The field can not be exited
33
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
"P4" or "4" unless the number, with the correct
"P5" or "5" number of decimal places will fit in the
"P6" or "6" the field. or the field is blank. The
numeric,"-", and "." keys are active.
The minus sign will only print in the
first position of the field. If a
decimal point is in the field another one
can not be entered until the previous one
is deleted.
NOTE: A numeric field will be padded with leading
zeros if CODE$ contains a "P."
EXAMPLE: CODE$ = "3P" --- This allows numeric
input. It will return the data expanded,
or truncated to, 3 digits after the dec-
imal point and padded with leading zeros.
TR% is the top row of the field, or window.
If a window is designated, TR% must equal 1 to 23.
Without a window TR% must equal 1 to 25. Setting TR%
to 100 centers the field, or window, top to bottom.
LC% is the left column. If a window is
designated, LC% must equal 1 to 76 ( 36 in 40 column
mode ). With no window LC% must equal 1 to 79 ( 39 in
40 column mode ). If LC% = 100 the field, or window, is
centered left to right. If LC% is set so the input
field with a window, if specified, or with a prompt, if
specified, will not fit on the screen an error will be
reported.
WD% is the fields width. A date field must
have WD%=10 or WD%=8. A numeric field requires WD% to
be from the number of ( decimal places + 1 ) to 15, and
for an alpha/numeric field WD% can range from 1 to the
screen width minus 1 ( minus 4 if windowed ).
ATTR% is the window's and PROMPT$'s color.
The color of the input field is the inverse of the
window's color. The field's foreground color is the
same as the window's background color while the field's
background has the same color as the windows foreground.
SEE THE COLOR ATTRIBUTE CAHRT. To make the field's
foreground color high intensity, add 1000 to ATTR%.
EXAMPLE: ATTR% = 1160. ( 1000 + 160 ) The "160"
produces a flashing black on green window. ( SEE THE
COLOR ATTRIBUTE CHART. ). The "1000" makes the field
text high intensity green.
34
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
RES$ is the restrict string. It holds the
allowable characters which can be entered in the input
field. RES$ IS IGNORED IF CODE$ IS NOT ALPHA/NUMERIC
("A"). IF CODE$ IS ALPHA/NUMERIC ("A") AND RES$ = ""
ALL STANDARD ALPHA/NUMERIC KEYS ARE ALLOWABLE. (SEE
SETINPT IN SECTION 5.01 FOR DETAILS.)
RTRN$ is the string passed to, and returned
from the input field. A numeric string can be converted
to a number by using the VAL function.
EXAMPLE: IF RTRN$= "123.123" IT CAN BE CONVERTED TO A
NUMBER (A) WITH THE STATEMENT:
A = VAL(RTRN$)
A now equals 123.123
RKEY% is returned by INPTWIND. RKEY% = 1
if INPTWIND was exited by the RETURN key being pressed. RKEY%
= 0 if the ESC key caused INPTWIND to be exited.
BRDR% is the input windows border. ( SEE
THE BORDER DESIGNATION CHART ). If BRDR% = 0 a single
line input field ( no window ) is generated. If BRDR%
produces a title box window, PROMPT$ will printed in the
title box.
5.01 SETINPT ( SCRN%, COLWID%, EXIT$, INPT%(), INPT$(), ACTCOL% )
Description: Defines a multi-field input screen, which
will be called by MULTINPT.
Arguments: SCRN% is the number or the screen being
defined. SCRN% may range from 1 to 10.
COLWID% is the column width of the screen
and must equal 40 or 80.
EXIT$ is the code for keys which will
exit the multi-field input routine for the designated
screen number. To make the function keys active place
their number "1","2" etc in EXIT$. A "0" represents
the F10 key, a "D" the PGDN key , a "U" the PGUP key and
an "E" the ESC key.
EXAMPLE: IF EXIT$ ="03U" THE F10, F3, OR PGUP KEYS WILL
EXIT THE MULTI-FIELD INPUT ROUTINE ( MULTINPT ).
NOTE: If the ESC key is not used as an exit key it is
35
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
used to return the text in a field in MULTINPT to it's
pre-edited state. This feature is disabled when ESC is
used as an exit key. The SPACE BAR can also be an exit
key for individual fields in MULTINPT if a field is a
FIXED CHOICE field. See the description for argument
INPT%(), element CODE%, in this routine to use FIXED
CHOICE fields.
INPT%() and INPT$() hold the data
representing the parameters for each field in the multi-
field input screen. Starting at INPT%(1) and INPT$(1),
the elements of INPT%() AND INPT$() are as follows;
------------ INPT%() ---------- -INPT$()-
1 2 3 4 5 6 1
(Field #1) CODE%, TR%, LC%, WD%, ATTR%, 99, RES$
(Field #2) ...... Repeat above for each field
9999 ( signals end of INPT%()/INPT$() )
INPT%(1)=CODE% FOR FIELD 1, INPT%(7)=CODE% FOR FIELD 2
INPT$(1)=RES$ FOR FIELD 1, INPT$(2)=RES$ FOR FIELD 2
CODE% is the code for type of input field
and can be as follows;
0 to 6 ----- The field is numeric with the indicated
number of decimal places.
10 to 16 --- The field is numeric with padded zeros.
Subtract 10 to obtain the number of decimal places.
7 ---------- The field is alpha/numeric.
8 ---------- The field is a date field.
17 --------- The field is alpha/numeric. (upper case)
27 --------- The field is alpha/numeric. (lower case)
SEE ROUTINE "INPTWIND", ARGUMENT CODE$, FOR A DESCRIP-
TION AND INPUT LIMITATIONS FOR FIELDS BASED ON THEIR
DESIGNATION.
Adding 100 to CODE% makes the field protected. A
protected field will be displayed but can not be
edited. A protected field can not be an Auto-advance
or Auto-exit field. If a protected field is defined as
an Auto-exit or Auto-advance field the definition is
ignored and the field remains a protected field.
Adding 1000 to CODE% makes the field an Auto-advance
field. When the cursor reaches the end of an Auto-
advance field, via typing a character, it moves to the
next field. ( User defined order. )
36
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
Adding 10000 to CODE% makes the field an "Auto-exit
always" field. The multi-field input routine will be
exited whenever the cursor is moved from an "Auto-exit
always" field.
Adding 20000 to CODE% makes the field an "Auto-exit on
change" field. The multi-field input routine will be
exited only when the data in the field is changed and
the cursor is moved from the field. This is useful if a
field is part of a formula to calculate another fields
value.
Adding 30000 to CODE% makes the field a "Fixed choice"
field. The multi-field input routine will be exited if
the space bar is pressed or if the cursor is moved from
a "fixed choice" field. This also makes the field an
auto-exit (always) field. The description for the
procedure MULTINPT describes the details of a "fixed
choice" field.
EXAMPLE: If CODE%= 21017 THEN CODE% = 20000+1000+17.
THE FIELD IS ALPHA/NUMERIC ( UPPER CASE ), AUTO-ADVANCE
AND "AUTO-EXIT ON CHANGE".
** SEE THE MULTI-FIELD CODE CHART IN THE APPENDIX.**
TR%, LC%, and WD% are the same as in
INPTWIND.
ATTR% is the fields color.
99 is a check and must follow the numeric
data which defines each field.
RES$ defines the allowable characters
in a restricted field. If the field is not set to
alpha/numeric by CODE%, RES$ is ignored. Setting RES$ to
"YN" and CODE% TO 17 ( UPPER CASE ) allows the field to
respond to Y,y,N or n. If CODE% = 7 ( UPPER AND LOWER
CASE ) and RES$ ="YN" the field is restricted to Y or N.
IF CODE%=27 ( LOWER CASE ) and RES$ ="YN" the field will
not allow any characters. If RES$ = "" the field is not
restricted and will respond to characters predicated on
the value of CODE%.
NOTE: IT IS ONLY NECESSARY TO USE RES$ FOR NON-STANDARD
FIELDS. SET RES$ TO "" FOR NORMAL ALPHA/NUMERIC FIELDS
OR THE RESULT WILL BE EXTRA CODE AND MEMORY USAGE. IF
THE FIELD IS STANDARD ALPHA/NUMERIC MAKE CODE% = 7 AND
RES$ = "". THIS WILL ALLOW UPPER/LOWER CASE ALPHA/NUM-
ERIC INPUT.
37
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
EXAMPLE: RES$ = "0123456789-( )"
THIS RESTRICTS INPUT TO CHARACTERS INCLUDED IN
A PHONE NUMBER WITH THE AREA CODE.
ACTCOL% is the color attribute of the active
input field. Use ACTCOL% to make the active field a
different color than the inactive fields. If ACTCOL% = 0,
ACTCOL% is ignored and the active field's color will not
change. ACTCOL% is adjusted to ACTCOL% MOD 128.
-------------------------------------------------------
'EXAMPLE OF A CALL TO SETINPT
A% = 20: B% = 3 ' SET UP TEMPORARY ARRAYS FOR DATA.
DIM INPT% (A%), INPT$(B%) ' USE THIS METHOD SO ARRAY WILL BE
' DYNAMIC AND CAN BE DE-ALLOCATED
' LATER. DON'T USE DIM INPT%(20)
FLD% = 1
B% = 1 ' ALWAYS START THE ARRAYS AT 1
DO ' OR THE FIRST FIELD WILL BE
READ INPT%(B%) ' LOST.
IF INPT%(B%)=9999 THEN EXIT DO ' 9999 MARKS THE END
B% = B% + 1
FOR X% = 1 TO 5
READ INPT%(B%) ' READ REMAINING NUMERIC DATA
B% =B% + 1 ' IN INPT%(). TR%,LC%,WD%
NEXT ' ATTR% AND THE CHECK (99).
READ INPT$(FLD%) ' THEN READ INPT$() DATA FOR
FLD% = FLD% + 1 ' RESTRICTED FIELDS.
LOOP
DATA 0,1,1,15,112,99,""
' NUMERIC - TR%=1, LC%=1, WD%=15, ATTR%=7, CHECK MUST=99
' NOT RESTRICTED. THIS IS FIELD #1 (1st DATA STATEMENT)
DATA 17,3,1,1,112,99,"YN"
' ALPHA/NUM ( UPPER CASE ) TR%=3, LC%=1, WD%=1, ATTR%=7
' CHECK MUST=99, RESTRICTED TO Y,N,y,or n.
' THIS FIELD #2 (2nd DATA STATEMENT)
DATA 108,5,1,10,32,99,""
' PROTECTED DATE - TR%=5, LC%=1 WD%=10, ATTR%=32
' CHECK MUST = 99', NOT RESTRICTED
' THIS IS FIELD #3 (3rd DATA STATEMENT)
DATA 9999
' 9999 MARKS THE END
38
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
CALL SETINPT( 1, 80, "12", INPT%(), INPT$(), 15 )
ERASE INPT%, INPT$ ' GET THE MEMORY BACK
'------------------------------------------------------
' THE MULTI-FIELD INPUT SCREEN (#1) IS 80 COLUMNS WIDE
' AND WILL BE EXITED IF THE F1 OR F2 KEYS ARE PRESSED.
' THERE ARE 3 FIELDS AS PER THE DATA STATEMENTS. A CALL
' TO MULTINPT WILL DISPLAY THE FIELDS AND WAIT FOR
' INPUT. INPUT ENDS WHEN THE F1 OR F2 KEYS ARE PRESSED.
' THE ACTIVE FIELD WILL BE HIGH INTENSTIY WHITE ON BLACK.
'-------------------------------------------------------
5.02 MULTINPT ( SCRN%, FLD%, EXIT$, AUTOEXIT%, RKEY%, RTRN$() )
Description: Displays input fields defined in a previous
call to SETINPT. Fields are available for full editing
Returns edited strings to the calling program.
Arguments: SCRN% is the number ( 1 to 10 ) of the
multi-field input screen to display.
FLD% serves two purposes. When entering
MULTINPT, FLD% determines which field will be the
active field ( the one with the cursor ). It may range
from one to the last field as designated by SETINPT.
When exiting MULTINPT, FLD% points to the next field the
cursor would normally occupy. If a field is auto-exit
( always ) and the down arrow is pressed, MULTINPT will
be exited. FLD% will point to the field the cursor
would normally occupy via the down arrow being pressed.
This enables MULTINPT to be exited by an auto-exit
field and re-entered at the correct field. If the field
is a fixed choice field and the space bar is pressed,
FLD% will point to the fixed choice field ( the one the
cursor was in before MULTINPT was exited ).
EXIT$ is also multi-purposed. When
entering MULTINPT, setting EXIT$ to "VIEW" causes
MULTINPT fill a field or all fields with their
corresponding data. MULTINPT is then exited. This is
useful for viewing a multi-field screen or updating a
single field ( see AUTOEXIT% ).
39
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
MULTINPT will be exited and EXIT$ will equal "F1" to
"F10", "PGUP", "PGDN", "ESC", or "FIXED" when a valid
exit key was pressed. Valid exit keys are determined
via the call to SETINPT for the multi-field input
screen. Valid exit keys may also include the SPACE BAR.
EXIT$ will equal "FIXED" if MULTINPT is exited when the
SPACE BAR is pressed and the cursor is in a fixed choice
field. It is important to note that fixed choice fields
are also auto-exit ( always ) fields. If a fixed choice
field is exited via the cursor moving from it to another
field EXIT$ will equal "AUTO".
MULTINPT will be exited and EXIT$ will equal "AUTO"
under the following conditions.
1. The cursor was moved from an auto-exit ( always )
field to another field. This is also the case if the
cursor is moved from a fixed choice field.
2. The cursor was moved from an auto-exit ( on change )
field to another field and the text in the auto-exit
( on change ) field was altered. This includes fixed
choice fields.
AUTOEXIT% also serves two purposes. If
AUTOEXIT% is set to zero, MULTINPT, when entered, will
update all fields. If AUTOEXIT% is set from one to the
last field number only the specified field is updated.
This allows quick exiting from, and re-entering of
MULTINPT.
When MULTINPT is exited AUTOEXIT% is set to zero or to
an auto-exit field number. The value of AUTOEXIT%
remains the same if MULTINPT is exited by an exit key
(F1,F2..) or by an auto-exit or fixed choice field. The
following conditions will set AUTOEXIT% to a field
number on exit ( not zero ).
1. The cursor was in an auto-exit field ( always )
field and MULTINPT was exited by an exit key or the
auto-exit feature ( cursor moving from the field ).
2. The cursor was in an autoexit ( on change ) field,
the field's data was changed, and MUTINPT was exited
by an exit key or the auto-exit feature.
3. The cursor was in a fixed choice field and MULTINPT
was exited by an exit key, by the space bar being
pressed, or by moving the cursor from the fixed
choice field. As previously stated fixed choice
fields are also autoexit ( always ) fields.
40
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
NOTE: If the cursor is in an auto-exit or fixed choice
field and MULTINPT is exited via an exit key (F1,F2..)
EXIT$ will not equal "AUTO". It will equal the key
pressed ( F1,F2 .. etc. ). Check AUTOEXIT% to verify
if the cursor was in an auto-exit field when MULTINPT
was exited.
If AUTOEXIT% equals a valid field number ( not zero) and
EXIT$ = "VIEW" when entering MULTINPT, the field
specified by the value of AUTOEXIT% will be updated and
MULTINPT will be exited. This method can be used to
update any single field and exit.
RKEY% returns a value designation for the
key or feature which caused MULTINPT to be auto-exited.
MULTINPT is auto-exited whenever the cursor is moved out
of an auto-exit ( always ) field, fixed choice, or auto-
exit ( on change ) field and the field's text was
changed. MULTINPT is also auto-exited when the SPACE
BAR is pressed with the cursor in a fixed choice field.
RKEY% may equal:
0 --- An exit key ( F1,F2 etc. ) caused MULTINPT to be
exited. MULTINPT was not exited by the auto-exit
feature.
13 -- The RETURN key caused MULTINPT to be auto-exited.
14 -- SHIFT TAB or the LEFT ARROW caused MULTINPT to be
auto-exited.
15 -- The TAB key or RIGHT ARROW caused MULTINPT to be
auto-exited.
16 -- The UP ARROW caused MULTINPT to be auto-exited.
17 -- The CONTROL-HOME combination caused MULTINPT to be
auto-exited.
18 -- The CONTROL-END combination caused MULTINPT to be
auto-exited.
19 -- The DOWN ARROW cause MULTINPT to be auto-exited.
20 -- The AUTO-ADVANCE feature caused MULTINPT to be
auto-exited. The field must also be an auto-exit
field. This occurs when the text fills an auto-
advance, auto-exit, field.
32 -- The SPACE BAR cause MULTINPT to be auto-exited.
This is appropriate for fixed choice fields.
RTRN$() is a string array which holds the
data to be edited. Elements of RTRN$() will be
displayed in the appropriate fields. RTRN$(1) will be
displayed in field 1 and so on. Make sure there is not
a RTRN$(0) as it will not be displayed. If a field is
41
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
numeric, the number to be placed in it must be converted
to a string. Convert the number (A) to a string as
follows: RTRN$(2) = STR$(A)
When MULTINPT is exited RTRN$() holds the data in it's
edited state.
Upon entering MULTINPT, if the field is designated as
alpha/numeric and the string will not fit in the field
it will be truncated to fit. If the field is numeric
and a number formatted to the correct number of decimal
places will not fit in the field, "*"'s will be printed.
This will not pose a problem if RTRN$() is initialized
via MULTINPT, as MULTINPT will not allow the user to
input data longer than the field's width. If a numeric
field is entered with an alpha string the string will
print in the field. It is the programmer's responsibility
to assure numeric fields contain numeric strings. IF
A FIELD IS NUMERIC WITH 4 DECIMAL PLACES SETTING THE
FIELD TO EQUAL "DOG", WILL RESULT IN DOG.0000 BEING
DISPLAYED!
Use caution if a field is a result of calculation, as
the result may be in exponential format. EXAMPLE:
A = 1 B = 14 C = A/B
STR$(C) = "7.142857E-02". If the field is numeric with
four decimal places and set to equal STR$(C) it will
print as 7.1428, and not as .0714.
To following routine corrects numbers in expoential form
for both large and small numbers. A$ is the numeric
string to be displayed in a field.
IF INSTR(3, A$, "+") THEN A$ = "9999999999999999"
REM: THE NUMBER WAS TOO LARGE. ( EX: 2.2D+22 )
REM: SET TO "9999999999999999" AND "*"'s WILL
REM :BE DISPLAYED.
IF INSTR(3, A$, "-") THEN
A# = VAL(A$): A# = A# + SGN(A#): A$ = STR$(A#)
IF ABS(A#) > 1 THEN
A$ = MID$(A$, INSTR(A$, "."))
IF A# < 1 THEN A$ = "-" + A$
ELSE
A$="0"
END IF
END IF
REM: THE NUMBER WAS TOO SMALL. IF A$ = "3.33D-4",
REM: A$ WILL NOW = ".000333"
42
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
---------------------------------------------------------------
FIELD EDITING FEATURES FOR "MULTINPT" AND "INPTWIND"
( * = AVAILABLE FOR "MULTINPT" ONLY. )
---------------------------------------------------------------
KEY FUNCTION
SPACE BAR ERASES FIELD - IF IT IS THE FIRST KEY PRESSED.
*UP ARROW MOVES THE CURSOR FROM FIELD TO FIELD AS DETER-
*DOWN ARROW MINED BY THE ORDER DEFINED IN "SETINPT." THE
DOWN ARROW MOVES THE CURSOR IN ASCENDING FIELD
ORDER. THE UP ARROW MOVES IT IN DESCENDING
FIELD ORDER. PROTECTED FIELDS ARE SKIPPED.
*CTRL END MOVES THE CURSOR TO THE FIRST OR LAST FIELD AS
*CTRL HOME DESIGNATED BY THE ORDER DEFINED IN "SETINPT".
*TAB MOVES THE CURSOR FROM FIELD TO FIELD HORIZONT-
*SHIFT TAB ALLY. TAB MOVES LEFT TO RIGHT, SHIFT TAB MOVES
RIGHT TO LEFT. PROTECTED FIELDS ARE SKIPPED.
CTRL E ERASES THE FIELD.
ESC RETURNS A FIELD TO IT'S PRE-EDITED STATE OR
EXITS "MULTINPT". EXITS "INPTWIND" WITH PRE-
EDITED STRING. ESC EXITS "MULTINPT" IF THE
ESC KEY WAS DESIGNATED AS AND EXIT KEY BY
"SETINPT" ( FIELD NOT RESTORED TO PRE-EDITED
STATE ).
ENTER EXITS "INPTWIND". SAME AS DOWN ARROW FOR
RETURN "MULTINPT".
END MOVES THE CURSOR TO THE FIRST OR LAST POSITION
HOME OF TEXT WITHIN A FIELD.
BACKSPACE DELETES THE CHARACTER TO THE LEFT OF CURSOR.
DELETE DELETES THE CHARACTER UNDER THE CURSOR AND
SHIFTS CHARACTERS LEFT.
INSERT TOGGLES FROM INSERT TO OVERSTRIKE MODE. IF MODE
IS OVERSTRIKE THE CURSOR IS LARGE. INSERT MODE
IS THE DEFAULT EVERY TIME A FIELD IS ENTERED.
RIGHT ARROW MOVES THE CURSOR LEFT OR RIGHT. ACTS THE SAME
LEFT ARROW AS TAB OR SHIFT TAB FOR "MULTINPT" IF THE
CURSOR IN IN POSITION 1 AND THE LEFT ARROW IS
PRESSED, OR THE CURSOR IS AT THE END OF THE
TEXT AND THE RIGHT ARROW IS PRESSED.
43
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
***** DIRECTORY ROUTINES *****
Directory routines compliment features included with
QuickBASIC and BASIC 7.+ ( PDS ).. Procedures to find the
current disk, current path, disk capacity, and disk space
available are supplied with WINDOWS R-E-Z. Also included are
routines to find the directory of any disk or path. In
addition a file's size, date, time, and attributes can be
found.
6.00 GETDISK (DRIVE%)
Description: Retrieves the default disk drive.
Argument: DRIVE% is the current drive. DRIVE% = 1
for drive A:, 2 for B:, 3 for C:, 4 for D:, etc.
6.01 FINDPATH (PATH$)
NOTE: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING THIS
ROUTINE. SEE SECTION " MAKING A DIRECTORY SCROLL
WINDOW"
Description: Retrieves the current path ( directory ).
Argument: PATH$ is the path in the format:
DRIVE:\SUB-DIRECTORY\SUB-DIRECTORY\....
PATH$ always starts with the drive letter and always
ends with a "\".
6.02 SETDISK (DRIVE%, BADFLAG%)
Description: Changes the default drive.
Arguments: DRIVE% is the drive designation. DRIVE% =
1 for drive A:, 2 for B:, 3 for C:, etc.
BADFLAG% = 1 if DRIVE% is less than 1 or
greater than the number of logical drives. BADFLAG% = 0
if DRIVE% is in the range from 1 to the number of logical
drives in the system.
NOTE: A SYSTEM WITH A FLOPPY DRIVE FOR DRIVE A: AND A
44
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
HARD DISK FOR DRIVE C: HAS 3 LOGICAL DRIVES. THEREFORE,
BADFLAG% WILL = 0 IF DRIVE% = 1 TO 3 EVEN THOUGH A
PHYSICAL DRIVE B: DOES NOT EXIST. ATTEMPTS TO ACCESS
DRIVE B: MAY RESULT IN THE DOS MESSAGE. "Place a disk in
drive B: and press any key" BEING DISPLAYED.
6.03 DISKSIZE (DRIVE%, SIZE&, FREE&)
NOTE: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING THIS
ROUTINE. SEE SECTION " MAKING A SCROLL DIRECTORY
WINDOW".
Description: Retrieves disk space and disk free space.
Arguments: DRIVE% is the drive designation. It
follows the same rules as detailed in SETDISK. The note
for SETDISK applies.
SIZE& is the size in bytes of disk space.
FREE& is the size in bytes of free disk
space.
NOTE: THE ARGUMENTS FOR SIZE AND FREE SPACE ARE LONG
INTEGERS. ANY VARIABLE USED TO REPRESENT THEM MUST BE
DESIGNATED AS A LONG INTEGER ( FOLLOWED BY A "&" SIGN )
OR A PARAMETER MIS-MATCH WILL BE REPORTED.
6.04 FINDDIR (PATH$, TYP$, FILE%)
NOTE # 1: THE FOLLOWING MUST BE PLACED BEFORE ANY
EXECUTABLE STATEMENTS IN ANY MODULE CALLING "FINDIR"
TYPE DIREC
SIZE AS LONG
DATE AS STRING * 10
TIME AS STRING * 6
ATTR AS INTEGER
END TYPE
COMMON SHARED /DIRECTORY/ DIREC$(), DIRINFO() AS DIREC
NOTE # 2: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING
THIS ROUTINE. SEE SECTION " MAKING A SCROLL DIRECTORY
WINDOW"
Description: Puts the directory listing of the
specified path in an array, DIREC$(). If a long
directory search is requested the files size, date, time
and attributes are also placed in array, DIRINFO(). The
arrays MUST be defined as explained above in NOTE # 1.
45
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
Arguments: PATH$ is the path for the directory
listing search. It must be in the same format as
returned by the procedure FINDPATH. It may be expanded
to restrict the search. Wildcards are permitted.
EXAMPLE: IF PATH$ = "C:\TEST\*.BAS", THE SEARCH WILL
FIND FILES IN DRIVE C:, SUB-DIRECTORY "TEST", WITH THE
EXTENSION ".BAS".
TYP$ restricts or expands the search to
include files with specified attributes. An "L" in TYP$
tells FINDDIR to make a long directory search. The
file's size, date, time and attributes are found in a
long directory search, in addition to the files name,
TYP$ may contain any combination of the following:
A - files archive bit set
H - hidden files
S - system files
R - read only files
D - sub-directory listings
V - volume entry
O - no file attribute
L - long directory search - SEE ABOVE
EXAMPLE: IF TYP$ = "HS" ONLY HIDDEN AND SYSTEM FILES
WILL BE FOUND.
FILE% is the number of files found. FILE% =
0 if no files were found.
If files are found their names are placed in the array,
DIREC$(). A long directory search places the file's
size, date, time and attrtibute designation in
DIRINFO().
DIREC$(1) = The name of first file found.
DIRINFO(1).SIZE = The size of the file.
DIRINFO(1).DATE = The files creation or last update date.
DIRINFO(1).TIME = The files creation or last update time.
DIRINFO(1).ATTR = The files attribute designation.
The following describes DIRINFO(1).ATTR;
IF DIRINFO(1).ATTR AND 1 the file is a read only file.
IF DIRINFO(1).ATTR AND 2 the file is a hidden file.
IF DIRINFO(1).ATTR AND 4 the file is a system file.
IF DIRINFO(1).ATTR AND 8 the entry is a volumn entry.
IF DIRINFO(1).ATTR AND 16 the entry is a sub-directory.
46
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
IF DIRINFO(1).ATTR AND 32 the files archived bit is set.
IF DIRINFO(1).ATTR = 0 the file has no attribute.
NOTE: WHEN FINDDIR IS CALLED THE ARRAY, DIREC$() IS
AUTOMATICALLY DIMENSIONED TO THE NUMBER OF FILES FOUND.
THE ARRAY, DIRINFO() IS ALSO DIMENSIONED TO THE NUMBER
OF FILES FOUND PROVIDING THE DIRECTORY SEARCH IS A LONG
DIRECTORY SEARCH. EACH FILE FOUND USES ABOUT 16 BYTES
OF MEMORY PLUS AN ADDITIONAL 22 BYTES IF THE DIRECTORY
SEARCH IS LONG. TO RECLAIM THE MEMORY ( AFTER USING THE
INFORMATION RETURNED BY THE CALL TO FINDDIR ) THE ARRAYS
MUST BE ERASED VIA THE STATEMENT:
ERASE DIREC$, DIRINFO
47
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
***** MAKING A DIRECTORY SCROLL WINDOW *****
REM: THIS EXAMPLE FINDS THE DIRECTORY LISTING OF
REM: ARCHIVED FILES IN DRIVE A. IT PUTS THE LISTING IN
REM: A SCROLL WINDOW AND WAITS FOR THE SELECTION OF A
REM: FILE.
TYPE DIREC ' REQUIRED IN ANY MODULE
SIZE AS LONG ' USING DIRECTORY ROUTINES.
DATE AS STRING * 10
TIME AS STRING * 6
ATTR AS INTEGER
END TYPE
COMMON SHARED /DIRECTORY/ DIREC$(), DIRINFO() AS DIREC
CALL SETWIND(1, 1, 7, 0, 1, 1, 1) ' INITIALIZE
START:
CLS
ON ERROR GOTO DISKERROR ' ALWAYS TRAP FOR DISK
' ERRORS.
REM: AS TYP$ INCLUDES AN "A",THE FOLLOWING CALL TO
REM: FINDDIR PLACES ARCHIVED FILES, FROM DRIVE A:,
REM: ("A:\"), IN DIREC$(). AS TYP$ INCLUDES AN "L" THE
REM: FILES SIZE, DATE, TIME AND ATTRIBUTES ARE PLACED IN
REM: DIRINFO(). FILE% HOLDS THE NUMBER OF FILES FOUND.
TYP$ ="AL"
CALL FINDDIR ("A:\", TYP$, FILE%)
IF FILE% > 0 THEN ' ONLY IF FILES EXISTED.
REM: MAKE A WINDOW. STATEMENT MUST BE ON 1 LINE
CALL MAKEWIND(1 ,"@Select file - Press ENTER",
100 ,100 ,30 ,10 ,15 ,101)
REM: MAKE IT AN AUTO-EXIT SCROLL WINDOW.
KIND$ ="A" ' AUTO-EXIT FEATURE IS ON.
CALL SCRLWIND(DIREC$(), FILE%, KIND$, RTRN%, 0)
IF RTRN% <> 0 THEN
LOCATE 1,1
PRINT "FILE .......";DIREC$(RTRN%)
PRINT "SIZE........";DIRINFO(RTRN%).SIZE
48
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
PRINT "DATE........";DIRINFO(RTRN%).DATE
PRINT "TIME........";DIRINFO(RTRN%).TIME
PRINT "ATTRIBUTE...";DIRINFO(RTRN%).ATTR
ERASE DIREC$, DIRINFO
END IF
CALL RSTRWIND(1,1) ' REMOVE THE WINDOW
IF RTRN%= 0 THEN GOTO START 'ESC WAS PRESSED
ELSE ' FILE% = 0 ( NO FILES WERE FOUND )
PRINT "NO FILES WERE FOUND" ENDIF
ON ERROR GOTO 0 ' TURN OFF ERROR DETECTION
END
DISKERROR:
REM: ERR = ERROR NUMBER. THIS ERROR HANDLING ROUTINE
REM: WILL DETECT IF DISK IS NOT READY, NOT AVAILABLE,
REM: OR PATH WAS BAD.
SELECT CASE ERR
CASE 71
E$ = "DISK NOT READY"
CASE 68
E$ = "DISK NOT AVAILABLE"
CASE 76
E$ = "PATH NOT FOUND"
CASE ELSE
E$ = "UN-IDENTIFIED DISK ERROR"
END SELECT
REM: FOLLOWING MUST BE ON ONE LINE
CALL GETANS("DISK ERROR: " + E$ + " Press any key.."
,"", "",100 ,100, 143, 1)
RESUME START
49
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
**** KEYBOARD AND MOUSE ROUTINES ****
Adding the ability to "read the mouse" these routines provide
increased flexibility over BASIC's INKEY$ statement.
NOTE: THESE ARE ASSEMBLY ROUTINES. ALWAYS PLACE THEM IN
DECLARE STATEMENTS IN ANY MODULE WHICH USES THEM. THIS
WILL ASSURE ARGUMENT MATCHING AND PREVENT ACCIDENTAL
PROGRAM "CRASHES".
7.00 KEYMOUSE%
Description: KEYMOUSE% is a function. It pauses program
execution. Upon keyboard or mouse input the program
resumes with the appropriate code returned in KEYMOUSE%.
The mouse buttons are user defineable via the procedure
MBUTTONS. Mouse movement emulates the arrow keys. Up,
down, left, and right mouse movement places the same
value in KEYMOUSE% as the corresponding arrow key. If
the key or mouse button pressed produces a standard
ASCII/IBM character, the code for the character ( 1 to
255 ) is returned in KEYMOUSE%. If the key pressed, or
mouse movement, produces an extended scan code such as
the up arrow, the extended scan code for the key
multiplied by 256 is returned in KEYMOUSE%. KEYMOUSE%
returns 18432 ( 72 * 256 ) for the up arrow. For those
keys which produce an extended scan code over 127, such
as CTRL-PGUP ( 129 ), KEYMOUSE% returns a negative
value. SEE THE KEYMOUSE CODE CHART IN THE APPENDIX.
-------------------------------------------------------
'EXAMPLE: WAITS FOR RETURN, "A", DOWN ARROW, OR END.
'PRESS END TO END
DECLARE FUNCTION KEYMOUSE%
INPT:
A% = KEYMOUSE% ' PROGRAM WAITS FOR INPUT HERE
SELECT CASE A%
CASE 13 ' 13 IS ASCII FOR THE RETURN KEY
PRINT "RETURN"
CASE 65 ' 65 IS ASCII FOR "A"
PRINT "A"
CASE 80 * 256 ' 80 IS THE EXTENDED SCAN
PRINT "DOWN ARROW" ' CODE FOR THE DOWN ARROW.
CASE 79 * 256 ' 79 IS THE EXTENDED SCAN
PRINT "END" ' FOR END.
END
CASE ELSE
GOTO INPT
END SELECT
GOTO INPT
--------------------------------------------------------
50
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
7.01 MBUTTONS% ( LBUTTON%, RBUTTON%)
NOTE: THIS ROUTINE MUST BE CALLED AT LEAST ONCE IN ANY
PROGRAM BEFORE ATTEMPTING TO USE THE MOUSE.
Description: Sets the values which will be placed in
function KEYMOUSE% for the left and right mouse buttons.
Arguments: LBUTTON% sets the value which will be
returned in function KEYMOUSE% when te left mouse button
is pressed. It may range from 0 to 255. If LBUTTON% is
greater than 255 it is converted to LBUTTON% AND 255
RBUTTON% sets the value which will be
returned in function KEYMOUSE% when te right mouse
button is pressed. It may range from 0 to 255. If
RBUTTON% is greater than 255 it is converted to
LBUTTON% and 255.
--------------------------------------------------------
' EXAMPLE: SETS THE LEFT MOUSE BUTTON TO "RETURN" AND
' THE RIGHT MOUSE BUTTON TO "ESC". 13 IS THE ASCII CODE
' FOR "RETURN". 27 IS THE ASCII CODE FOR "ESC".
DECLARE SUB MBUTTONS ( LBUTTON%, RBUTTON% )
CALL MBUTTON ( 13, 27 )
--------------------------------------------------------
7.02 MOUSEON (ISON%)
NOTE: THIS ROUTINE MUST BE CALLED AT LEAST ONCE IN ANY
PROGRAM BEFORE ATTEMPTING TO USE THE MOUSE.
Description: Sets the mouse status.
Arguments: ISON% sets the mouse status as follows:
If ISON% = 0 the mouse is off.
If ISON% = 1 the mouse is on.
If ISON% = 2 the mouse buttons remain active
but mouse movement detection is disabled.
Any other value for ISON% sets the mouse to on.
-------------------------------------------------------------
8.00 DOSOUND
Description: Makes the default sound ,or sound as
specified by a previous call to SETWIND.
Arguments: None.
51
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
PROGRAM FORMAT FOR WINDOWS R-E-Z
** NOTE: ALL NUMERIC VALUES MUST BE INTEGERS FOR ALL **
PROCEDURES EXCEPT DISKSIZE. ( EX: A%, B%, DEFINT A-F )
1. LOAD QUICKBASIC WITH CORRECT LIBRARY.
- UNENHANCED VERSION:
EX: QB/L QB4UNEN.QLB ( QB 4.00, 4.00b, 4.50 )
QBX/L PDSUNEN.QLB ( BASIC 7.0, 7.1 - PDS )
- ENHANCED VERSION:
EX: QB/L QB4ALL.QLB ( QB 4.00, 4.00b, 4.50 )
QBX/L PDSALL70.QLB ( BASIC 7.0 - PDS )
QBX/L PDSALL71.QLB ( BASIC 7.1 - PDS )
2. DECLARE ALL SUB-ROUTINES AND FUNCTIONS.
REM $INCLUDE: 'DECLARE.INC'
' 3. CALL SETWIND TO INITIALIZE WINDOW MEMORY, TURN
' THE MOUSE ON AND SET MOUSE KEYS.
CALL SETWIND(1,1,7,0,1,1,1) 'FAST WINDOWS
'SOUND DEFAULTS TO "CLICK"
'SHADOW COLOR = GRAY
'HIGH INTENSITY IS OK
'PERIOD AS DECIMAL POINT
'SCROLL ARROW DISPLAYED
'DATE = MM-DD-YYYY
CALL MOUSEON (1) 'MOUSE IS ON
CALL MBUTTONS (13,27) 'LEFT BUTTON = ENTER
'RIGHT BUTTON = ESC
' 4. CALL SETPULL IF PULLDOWN WINDOWS ARE USED
BAR$ = "THIS IS A SAMPLE" ' DEFINE MENUBAR
A%= 25
DIM PWIND$(A%) ' SET TEMPORARY
' ARRAY
TEMP%=0
WHILE PWIND$(TEMP%) <> "ENDPULL"
TEMP% = TEMP% + 1 ' ALWAYS START AT 1
READ PWIND$(TEMP%) ' READ DATA FOR
WEND ' PULLDOWN WINDOWS.
CALL SETPULL (1, 1, 80, BAR$, PWIND$()) ' CALL SETPULL
ERASE PWIND$ ' AND ERASE ARRAY
52
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
' PULLDOWN WINDOW DATA
DATA HELLO,JOE,***
DATA HOW,ARE,YOU,***
DATA I,AM,FINE,***
DATA BYE,***
DATA ENDPULL
ON KEY(1) GOSUB PULL ' MAKE THE F1 KEY
' THE "HOT" KEY FOR
' PULLDOWN WINDOWS
'5. READ DATA FOR SCROLL WINDOW(S)
DIM LIST$(10) ' DIMENSION ARRAY
FOR X%= 1 TO 10 ' AND READ SCROLL
READ LIST$(X%) ' WINDOW DATA
NEXT
DATA ONE, TWO, THREE, FOUR, FIVE ' DATA FOR A SCROLL
DATA SIX, SEVEN, EIGHT, NINE, TEN ' WINDOW
'6. READ DATA FOR MULTI-FIELD INPUT SCREEN(S)
A%=20
B%=3
DIM INPT%(A%),INPT$(B%) ' TEMPORARY ARRAYS
TEMP% = 1 ' ALWAYS START AT 1
FLD%=1
DO
READ INPT%(TEMP%) ' READ CODE%.
' IF CODE%=9999 DONE.
IF INPT%(TEMP%)=9999 THEN EXIT DO
TEMP%=TEMP%+1
FOR X%=1 TO 5 ' READ REMAINING 5
READ INPT%(TEMP%) ' NUMERIC VALUES IN
' INPT%().
TEMP% = TEMP% + 1
NEXT
READ INPT$(FLD%) ' READ FIELD DATA IN
FLD%=FLD%+1 ' INPT$() - RESTRICT
LOOP ' DATA.
' MULTI- FIELD INPUT DATA
DATA 0,1,1,15,7,99,""
DATA 11007,3,1,40,7,99,""
DATA 108,5,1,10,32,99,""
DATA 9999
53
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
CALL SETINPT( 1, 80, "12", INPT%(), INPT$(),0 ) ' SET INPUT
' SCREEN.
ERASE INPT%,INPT$ ' GET THE MEMORY BACK
'7. ENTER THE PROGRAM
MAIN:
KEY (1) ON ' TURN ON "HOT" KEY AT
' . ' APPROPRIATE SPOT IN
' . ' PROGRAM.
' . ' WAIT FOR F1 KEY.
GOTO MAIN
REM PULL IS A SUB ROUTINE WHICH IS ENTERED VIA THE
REM F1 KEY BEING PRESSED. THIS SUB DISPLAYS THE
REM PULLDOWN WINDOW AND WAITS FOR AN ITEM TO BE
REM SELECTED FROM SAME. IF THE ESC KEY IS PRESSED
REM THE PROGRAM RESUMES EXECUTION WHERE IT WAS
REM INTERRUPTED BY THE F1 KEY. IF AN ITEM IS
REM SELECTED A ROUTINE IS EXECUTED. AFTER EXECUT-
REM ION THE PROGRAM CONTINUES AT MAIN.
REM THIS IS A SUGGESTION FOR A METHOD TO USE PULL-
REM DOWN WINDOWS. ALTERNATE METHODS MAY BE USED,
REM SUCH AS CALL "PULLDOWN" AT START OF PROGRAM.
REM AND NOT USING A HOT KEY.
PULL:
KEY (1) OFF
CALL PULLDOWN (MENUITEM% , WINDITEM%, 112, 0, 11)
SELECT CASE MENUITEM%
CASE 1 ' MENUBAR ITEM = THIS
SELECT CASE WINDITEM%
CASE 1 ' HELLO
' . ' ROUTINE FOR HELLO
' .
CASE 2 ' JOE
' . ' ROUTINE FOR JOE
' .
END SELECT
CASE 2 ' MENUBAR ITEM = IS
SELECT CASE WINDITEM%
CASE 1 ' HOW
' . ' ROUTINE FOR HOW
' .
54
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
CASE 2 ' ARE
' . ' ROUTINE FOR ARE
' .
CASE 3 ' YOU
' . ' ROUTINE FOR YOU
' .
END SELECT
CASE 3 ' MENUBAR ITEM = A
SELECT CASE WINDITEM%
CASE 1 ' I
' . ' ROUTINE FOR I
' .
CASE 2 ' AM
' . ' ROUTINE FOR AM
' .
CASE 3 ' FINE
' . ' ROUTINE FOR FINE
' .
END SELECT
CASE 4 ' MENUBAR ITEM = SAMPLE
' . ' ROUTINE FOR SAMPLE
' . ' ( OR BYE )
CASE ELSE ' MUST BE THE ESC
KEY (1) ON ' KEY
RETURN MAIN
END SELECT
KEY (1) ON
RETURN MAIN ' DONE WITH THE ROUTINE
' SELECTED FROM
' PULLDOWN WINDOWS
55
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
MAKING A CUSTOMIZED LIBRARY
( Enhanced version only )
Users familiar with LINK and LIB utilities may prefer to
create libraries outside of QuickBASIC's environment using
the appropriate object files. As individual assembly object
files can be linked together to create smaller libraries
this is the preferable method. See the section "FILES" for
a description of all files.
The libraries ( QB4ALL.QLB, PDSALL70.QLB, PDSALL71.QLB,
QB4ALL.LIB, PDSALL70.LIB and PDSALL71.LIB ) are complete and
contain all of the procedures in WINDOWS R-E-Z. If all of
the procedures are not required in your program customized
libraries using less memory may be made in the QuickBASIC
environment as follows:
For QB 4.00 and 4.00b:
1. Load QuickBASIC using the command QB/L QB4ASM. The file,
QB4ASM.QLB, contains the assembly routines required by
all of the other procedures.
2. Load the modules WIND_REZ.BAS and QB4MEM.BAS. ALL
PROCEDURES EXCEPT THOSE IN DIRWIND.BAS REQUIRE THESE
MODULES. They contain the basic windowing routines. If
this is all your program requires select the Make library
option from the Run menu in QuickBASIC (see your manual)
to make the library. ( QB4ASM.LIB must be present.)
3. Load any other modules your program requires. IF YOU
WANT TO USE PULLDOWN WINDOWS THE MODULES PULLDOWN.BAS
AND SCROLL.BAS MUST BOTH BE LOADED. All other
modules may be loaded independent of each other.
When all of the modules you will be using are loaded
make the library as in step 2.
Two libraries will be produced. The library with the suffix
.QLB is used in the QuickBASIC environment and the library
with the suffix .LIB must be available to produce an
executable file. To use your new library ( assuming a name
of NEWLIB.QLB ) exit QuickBASIC and reload with the command
QB/L NEWLIB.
For QuickBASIC version 4.50 and BASIC 7.+ ( PDS );
Versions 4.5 of QuickBasic and BASIC 7.0+ ( PDS ) do not use
the "full library" mode while linking. Therefore it is not
nesessary to build a customized library or link outside of
the QuickBASIC environment to produce the smallest possible
executable programs.
56
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
FILES
The following files are included with WINDOWS R-E-Z.
Files starting with "QB4" are for use with QB 4.00, QB 4.00b
and QB 4.50. These files are not included with WINDOWS R-E-Z
for BASIC 7.+ ( PDS ). Files starting with "PDS" are for
use with BASIC 7.+, ( PDS ) These files are not included
with WINDOWS R-E-Z for QB 4.+.
Library Files:
- Library consisting of all assembly procedures.
* QB4ASM.LIB -- For QuickBASIC 4.+
* PDSASM.LIB -- For BASIC 7.+
- QuickBASIC version of QB4ASM.LIB or PDSASM.LIB
* QB4ASM.QLB -- For QuickBASIC 4.+
* PDSASM.QLB -- For BASIC 7.+
- Library consisting of all assembly and BASIC procedures.
* QB4ALL.LIB --- For QuickBASIC 4.+
* PDSALL70.LIB - For Basic 7.0
* PDSALL71.LIB - For Basic 7.1
** QB4UNEN.LIB -- For QuickBASIC 4.+ ( unenhanced )
** PDSUNEN.LIB -- For BASIC 7.+ ( unenhanced )
- QuickBASIC version of QB4ALL.LIB, PDSALL70.QLB or
PDSALL71.QLB.
* QB4ALL.QLB --- For QuickBASIC 4.+
* PDSALL70.QLB - For BASIC 7.0
* PDSALL71.QLB - For BASIC 7.1
** QB4UNEN.QLB -- For QuickBASIC 4.+ ( unenhanced )
** PDSUNEN.QLB -- For BASIC 7.+ ( unenhanced )
- Library of all assembly and BASIC procedures without
error detection or window status. Program MUST be
completely "debugged" before these are used.
* QB4NER.LIB --- For QuickBASIC 4.+
* PDSNER70.LIB - For BASIC 7.0
* PDSNER71.LIB - For BASIC 7.1
- QuickBASIC version of QB4NER.LIB, PDSNER70.LIB or
PDSNER71.LIB.
* QB4NER.QLB --- For QuickBASIC 4.+
* PDSNER70.QLB - For BASIC 7.0
* PDSNER71.QLB - For BASIC 7.1
57
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
Object Files:
* QB4WIND.OBJ -- Object file of assembly windowing
* PDSWIND.OBJ routines.
* QB4INPT.OBJ -- Object file of assembly input routines.
* PDSINPT.OBJ " "
* QB4INPT2.OBJ " "
* PDSINPT2.OBJ " "
* QB4DIR.OBJ --- Object file of assembly directory
* PDSDIR.OBJ routines.
* QB4SCRL.OBJ -- Object file of assembly scroll routines.
* PDSSCRL.OBJ " "
* PDSMEM70.OBJ -- Alternate memory management module.
* PDSMEM71.OBJ -- " "
Basic Files:
DEMO.BAS ----- Source code for demonstration program.
* INPTWIND.BAS - BASIC source code for routines in
* PULLDOWN.BAS WINDOWS R-E-Z.
* SCROLL.BAS "
* WIND_REZ.BAS "
* DIRWIND.BAS "
* QB4MEM.BAS ( QuickBASIC 4.+ )
* PDSMEM.BAS ( BASIC 7.+ )
MULTSAM1.BAS Sample multi-field input program
MULTSAM2.BAS "
MULTSAM3.BAS "
NOTE: All BASIC files except QB4MEM.BAS and PDSMEM.BAS are
the same for QuickBASIC 4.+ and BASIC 7.0/7.1. All
basic routines, except those in DIRWIND.BAS, require
the presence of the module WIND_REZ.BAS.
Other Files:
WIND_REZ.DOC - This document.
PRNT.BAT ----- Batch file for printing WIND_REZ.DOC.
LAZPRNT.BAT -- Batch file for printing WIND_REZ.DOC on a
HP compatible lazer printer.
DECLARE.INC -- INCLUDE file containing DECLARE
statements for all routines.
ORDER.ME ----- Order form for WINDOWS R-E-Z.
READ.ME ----- Update information.
* QUICKREF.DOC - Quick reference guide.
* PRNT2.BAT ---- Batch file for printing QUICKREF.DOC.
* LAZRRNT2.BAT - Batch file for printing QUICKREF.DOC on a
HP compatible lazer printer.
* Not included with the unenhanced version of WINDOWS R-E-Z.
** Not included with the enhanced version of WINDOWS R-E-Z.
58
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
Errors
The following is a listing of the errors WINDOWS R-E-Z
will detect.
ERROR # DESCRIPTION
------------------------------------------------------------
ERROR 0 There is no active window. SCRLWIND, RESAVE
CLRWIND, PRINTW, LINEW, and NEWCOLOR require
an active window.
ERROR 1 SETWIND has not been called to initialize
window memory. This error will be reported if
the program uses a CLEAR statement and SETWIND
has not be called to re-initialize window
memory.
ERROR 2 A window number has been specified which is
out of range for the calling routine. Window
number 20 is the maximum window number for all
routines. Window number 1 is the minimim
window number for SAVEWIND, DELWIND, and
RSTRWIND. Window number 0 is the minimum
window number for MAKEWIND and CHNGWIND.
ERROR 3 The shadow, specified in a call to MAKEWIND,
will not fit on the screen. If this error is
displayed the window will fit on the screen
but the shadow will not.
ERROR 4 The window will not fit on the screen. The
left column plus the window's width makes the
window too wide or the top row plus the number
of rows makes the window too tall. The left
column and top row must be greater than 0.
GETANS makes a window with a width predicated
on the width of the prompt. INPTWIND makes a
window with a width based on the length of the
prompt plus the width of the input field.
PULLDOWN windows have a width based on the
longest item in the pulldown window's list.
This error is displayed for INPTWIND and
GETANS if no window is specified ( BORDER%=0 )
and the width of the prompt and/or field will
not fit on the screen.
ERROR 5 The border designation is not valid for the
calling routine. GETANS does not allow title
59
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
windows. PULLDOWN does not allow title
windows and only allows right-bottom shadows.
SEE THE BORDER DESIGNATION CHART.
ERROR 6 A request was made to CHNGWIND to make the
active window a non-existent window or a
window saved via SAVEWIND. The active window
can only be a window save by MAKEWIND.
ERROR 7 A call was made to RESAVE when the active
window was window number 0. RESAVE can only
resave active window 1 to 20.
ERROR 8 An window specified in a call to MAKEWIND or
SAVEWIND previouly existed. A window must be
deleted via a call to DELWIND or RSTRWIND
before the number assigened to it can be used
again. This error will not be reported for
window number 0 as it is not saved.
ERROR 11 A bad row number was specified in a call to
PRINTW or LINEW. The row number must be
greater than 0. PRINTW allows print on the
bottom border. LINEW does not. The string
specified in a call to PRINTW will not fit in
the window due to it's length or it's left
column ( start print ) position.
ERROR 21 The array ( LIST$() ) in a call to SCRLWIND
has a lower dimension greater than 1 or an
upper dimension less then the number of
entries ( ENTRIES% ) in the list.
ERROR 22 A call was made to SCRLWIND with less than one
entry ( ENTRIES% ).
ERROR 23 A scroll window requires a minimum width of 5.
ERROR 24 At least one of the strings in the list for a
scroll window ( SCRLWIND ) will not fit in the
window, allowing for a space on either side of
the string.
ERROR 31 The menubar string specified in a call to
SETPULL is missing or has the wrong format.
ERROR 32 The menubar string specified in a call to
SETPULL has over 10 items in it. A space
between two characters is the separator for
the items.
60
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
ERROR 33 The data supplied to SETPULL is in the wrong
format. The end of each pulldown window must
be represented by "***" in the data stream.
The end for all pulldown windows must be
represented by "ENDPULL". A pulldown window
entry is a null string.
ERROR 34 The row or left column position is out of
range for the routine SETPULL. The row
position may equal 1 to 21 and left column
positon may range from 1 to 73.
ERROR 35 There are no items in a pulldown window. Two
consecutive "***"'s may be in the data stream.
ERROR 36 The menubar has less than 2 items in it.
There must be spaces between the items.
ERROR 37 The manubar specified in a call to SETPULL is
too long to fit on the display. Two spaces
are placed between items in the menubar. Two
spaces pad the beginning and one space is
added to the end of the menubar.
ERROR 41 The requested width of in input field in
INPTWIND is out of range. The maximum width
is 15 for numeric fields, the screens width
minus 4 for windowed ALPHA/NUMERIC fields or
the screens width minus 1 for un-windowed
ALPHA/NUMERIC fields. The minimum width for a
numeric field is the number of decimal places
plus one. The minimum width for an ALPHA-
NUMERIC field is 1. A date field must have a
width of 8 or 10.
ERROR 42 The field code in INPTWIND does not consist of
legal characters. ("0","1","2","3","4","5","6",
"A","L","U","D","P0","P1","P2","P3","P4","P5,
or "P6 )
ERROR 51 The screen number in MULTINPT is less than one
or over 10.
ERROR 52 The array ( RTRN$() ) specified in a call to
MULTINPT has a lower dimension of greater than
one or an upper dimension less than the number
of fields in the multi-field input screen.
ERROR 53 The screen number in a call to MULTINPT was
not defined via a call to SETINPT.
61
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
ERROR 54 The field number specified in call to MULTINPT
is greater than the number of fields in the
multi-field input screen or less than one.
The auto-exit field is greater than the number
of fields in the multi-field input screen or
less than 0.
ERROR 55 The screen width when MULTINPT was called was
not the same as specified when the multi-field
input screen was defined by SETINPT.
ERROR 61 The screen number in a call to SETINPT is less
than one or greater than 10.
ERROR 62 The screen width in a call to SETINPT is not
80 or 40.
ERROR 63 The exit string ( EXIT$ ) in a call to SETINPT
is null or contains an illegal character.
Legal character are: "1234567890EUD".
ERROR 64 The input data ( INPT%(), INPUT$() ) is not in
the correct format in a call to SETWIND.
ERROR 65 Over 100 fields were defined in a call to
SETINPT.
ERROR 66 Less than 2 fields were defined in a call to
SETINPT.
ERROR 67 At least one field in a call to SETINPT has an
illegal field code. SEE THE MULTI-FIELD CODE
CHART.
ERROR 68 The field width is not appropriate for the
type of field specified in a call to SETINPT.
ERROR 69 The left position plus the width of a field
defined in a call to SETINPT will not allow
the field to fit on the screen. The row or
column position is less than one. The row
position of a field is greater than 26.
ERROR 70 All fields defined in a call to SETINPT are
protected fields. No input is possible.
ERROR 71 The cumulative total of restrict characters
for all fields for a multi-field input screen
defined via SETINPT is greater than 1023.
62
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
ERROR 72 The number of characters in a restrict string
( INPT$() ) for an individual field defined
in a call to SETINPT is greater than 255.
ERROR 73 The array ( INPT$() ) in SETINPT, which
defines the field's restrict strings is
dimensioned less than the number of fields or
has a lower dimension greater than one.
63
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
APPENDIX I
Color Attribute Chart
ATTRIBUTE BACKGROUND FOREGROUND
START END
0 ------ 15 BLACK NORMAL
16 ------ 31 BLUE NORMAL
32 ------ 47 GREEN NORMAL
48 ------ 63 CYAN NORMAL
64 ------ 79 RED NORMAL
80 ------ 95 MAGENTA NORMAL
96 ------ 111 BROWN NORMAL
112 ----- 127 LIGHT GRAY NORMAL
128 ----- 143 BLACK FLASHING
144 ----- 159 BLUE FLASHING
160 ----- 175 GREEN FLASHING
176 ----- 191 CYAN FLASHING
192 ----- 207 RED FLASHING
208 ----- 223 MAGENTA FLASHING
224 ----- 239 BROWN FLASHING
240 ----- 255 LIGHT GRAY FLASHING
-----------------------------------------------------------
OFFSET FROM START FOREGROUND
0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 LIGHT GRAY
8 DARK GRAY
9 LIGHT BLUE
10 LIGHT GREEN
11 LIGHT CYAN
12 LIGHT RED
13 LIGHT MAGENTA
14 YELLOW
15 WHITE
EXAMPLE: If the attribute = 242 then the background color is
light gray and the foreground flashes. The offset
from start = 242 - 240 or 2, so the foreground color
is green.
NOTE: GETANS and SCRLWIND allow a flashing border only.
CHNGPULL, PULLDOWN, AND MULTINPT will not allow a flashing
border or text.
64
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
APPENDIX II
Multi-field code chart
The code for each field can be up to five digits long. The
digits are numbered 5,4,3,2 and 1, with 1 being the least
significant digit and 5 the most significant digit.
DIGIT NUMBER ------- 5 4 3 2 1
EXAMPLE CODE% ------ 2 1 0 1 6
- Digits 1 and 2 set the field type and can be:
00 ------ Numeric - no decimal places.
01 to 06 - Numeric - 1 to 6 decimal places
10 ------- Numeric - no decimal places - padded with leading
zeros.
11 to 16 - Numeric - 1 to 6 decimal places - padded with
leading zeros.
07 ------- Alpha/numeric
17 ------- Alpha/numeric -- UPPER CASE
27 ------- Alpha/numeric -- lower case
08 ------- Date
- Digit 3 sets a protected field ( No entry ) and can be:
0 -------- Field is NOT protected.
1 -------- Field is protected.
- Digit 4 sets an Auto-advance field and can be:
0 -------- Field is NOT Auto-advance.
1 -------- Field is Auto-advance.
- Digit ---- 5 sets an Auto-exit field and can be:
0 -------- Field is NOT Auto-exit.
1 -------- Field is Auto-exit. ( Always )
2 -------- Field is Auto-exit. ( On change only )
3 -------- Field is Fixed-choice. ( auto-exit - always )
EXAMPLE: IF CODE% = 21016 the field is decimal with padded
zero's, Auto-advance, and Auto-exit ( on change ).
NOTE: If digit 3 is set to 1 (protected) digits 4 and 5 are
ignored .
65
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
APPENDIX III
Border Designations
DIGIT NUMBER 3 2 1
EXAMPLE BORDER% 1 2 1 ( 121 )
Digit 1 = Border Digit 2 = Shadow Digit 3 = Title Box
Example (121) = title box/ left bottom shadow/ single line border
------------------------------------------------------------------
:---Border---: :------- Shadow -----------:
Border Single Double Title Right Left Left Right
Value Line Line Box Bottom Bottom Top Top
0 No border, title box, or shadow
1 X
2 X
10 X
11 X X
12 X X
20 X
21 X X
22 X X
30 X
31 X X
32 X X
40 X
41 X X
42 X X
100 X
101 X X
102 X X
110 X X
111 X X X
112 X X X
120 X X
121 X X X
122 X X X
130 X X
131 X X X
132 X X X
140 X X
141 X X X
142 X X X
-------------------------------------------------------------------
See individual routines for restrictions.
66
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
APPENDIX IV
KEYMOUSE CODE VALUES
KEYMOUSE% Key(s)
1 to 255 The equivalent key which produces the
corresponding ASCII/IBM code.
( 65 = A, 66 = B etc. )
15104 F1
15360 F2
15616 F3
15872 F4
16128 F5
16384 F6
16640 F7
16896 F8
17152 F9
17408 F10
18432 UP ARROW ( MOUSE UP )
20480 DOWN ARROW ( MOUSE DOWN )
19200 LEFT ARROW ( MOUSE LEFT )
19712 RIGHT ARROW ( MOUSE RIGHT )
18688 PGUP
20736 PGDN
18176 HOME
20224 END
20992 INSERT
21248 DELETE
29952 CTRL-END
30464 CTRL-HOME
NOTE: THIS LIST IS NOT ALL INCLUSIVE. IT DOES PROVIDE
VALUES FOR COMMON KEYS OR KEY COMBINATIONS.
To find the values for other keys or key combinations this
small program can be used. Press ESC to end the program.
DECLARE FUNCTION KEYMOUSE%
GETKEY:
A%= KEYMOUSE%
PRINT A%
IF A% <> 27 THEN GOTO GETKEY
END
As a key or key combination is pressed the corresponding
value will print on the screen.
67
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.
RESTRICTIONS
------------------------------------------------------------
UNENHANCED LIBRARY
------------------
THE UNENHANCED LIBRARY IS OFFERED ON A TRIAL BASIS.
IT MAY BE USED FOR EVALUATION. EXECUTABLE PROGRAMS MADE
FROM THE UNENHANCED LIBRARY MAY NOT BE DISTRIBUTED. IF YOU
DECIDE THE ROUTINES ARE USEFUL, REGISTRATION MAY BE
ACCOMPLISHED BY VIRTUE OF SECURING THE ENHANCED VERSION.
THE UNENHANCED LIBRARY MAY NOT BE ALTERED. THE UNENHANCED
LIBRARY MAY BE DISTRIBUTED, PROVIDED IT IS DISTRIBUTED WITH
ALL OF THE FILES INCLUDED IN QWEZ42.ZIP OR PWEZ42.ZIP.
THE FILES, QWEZ42.ZIP OR PWEZ42.ZIP , MAY BE UP-
LOADED IN THEIR ENTIRETY TO ANY PUBLIC OR PRIVATE BULLETIN
BOARD. INDIVIDUAL FILES NOT BE UP-LOADED.
------------------------------------------------------------
ENHANCED VERSION
-----------------
ALL OF THE SOURCE CODE, OBJECT CODE, AND LIBRARIES
INCLUDED IN WINDOWS R-E-Z IS COPYRIGHTED. COPYING AND
DISTRIBUTING ANY OF THE MATERIAL IS PROHIBITED. PROGRAMS
MADE USING ANY OF THE PROCEDURES FROM WINDOWS R-E-Z IN THE
EXECUTABLE (.EXE ) FORM MAY BE DISTRIBUTED FREELY BY
ORIGINAL PURCHASERS.
------------------------------------------------------------
COPYRIGHT WARNING
-----------------
EXTRANEOUS CODE HAS BEEN INSERTED IN THE LIBRARY
FILES. ANY PROGRAM MADE USING THE LIBRARY FILES IS
DISTINGUISHABLE AS ORIGINATING FROM WINDOWS R-E-Z. CONNECT
SOFTWARE WILL TAKE APPROPRIATE ACTION IF COPYRIGHT
INFRINGEMENT IS DISCOVERED.
------------------------------------------------------------
DISCLAIMER
----------
ANY LOSS INCURRED FROM THE USE OF THE PROCEDURES CON-
TAINED IN WINDOWS R-E-Z, OR ANY LOSS BELIEVED TO BE CAUSED
FROM THE PROCEDURES CONTAINED IN WINDOWS R-E-Z IS NOT THE
RESPONSIBILITY OF CONNECT SOFTWARE. USERS OF WINDOWS R-E-Z
ASSUME FULL RESPONSIBILITY FOR THE USE OF ANY PROCEDURES
CONTAINED WITHIN.
------------------------------------------------------------
68
Copyright (c) 1988 - 1991 By:CONNECT Software All rights reserved.